fenv.ch

Declarations

Public Only
Publicstruct fexcept_t
struct fexcept_t
TODO fexcept_t is implementation defined

See Also

  • https:en.cppreference.com/w/c/numeric/fenv
Publicstruct fenv_t
struct fenv_t
TODO fenv_t is implementation defined

See Also

  • https:en.cppreference.com/w/c/numeric/fenv
Publicfunction feclearexcept
func feclearexcept(excepts : int) : int
Attempts to clear the floating-point exceptions that are listed in the bitmask argument excepts, which is a bitwise OR of the floating-point exception macros.

Parameters

  • excepts - bitmask listing the exception flags to clear @return 0 if all indicated exceptions were successfully cleared or if excepts is zero. Returns a non-zero value on error. @see https:en.cppreference.com/w/c/numeric/fenv/feclearexcept

Returns

0 if all indicated exceptions were successfully cleared or if excepts is zero. Returns a non-zero value on error. @see https:en.cppreference.com/w/c/numeric/fenv/feclearexcept

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/feclearexcept
Publicfunction fetestexcept
func fetestexcept(excepts : int) : int
Determines which of the specified subset of the floating-point exceptions are currently set. The argument excepts is a bitwise OR of the floating-point exception macros.

Parameters

  • excepts - bitmask listing the exception flags to test @return Bitwise OR of the floating-point exception macros that are both included in excepts and correspond to floating-point exceptions currently set. @see https:en.cppreference.com/w/c/numeric/fenv/fetestexcept

Returns

Bitwise OR of the floating-point exception macros that are both included in excepts and correspond to floating-point exceptions currently set. @see https:en.cppreference.com/w/c/numeric/fenv/fetestexcept

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/fetestexcept
Publicfunction feraiseexcept
func feraiseexcept(excepts : int) : int
Attempts to raise all floating-point exceptions listed in excepts (a bitwise OR of the floating-point exception macros). If one of the exceptions is FE_OVERFLOW or FE_UNDERFLOW, this function may additionally raise FE_INEXACT. The order in which the exceptions are raised is unspecified, except that FE_OVERFLOW and FE_UNDERFLOW are always raised before FE_INEXACT.

Parameters

  • excepts - bitmask listing the exception flags to raise @return 0 if all listed exceptions were raised, non-zero value otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feraiseexcept

Returns

0 if all listed exceptions were raised, non-zero value otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feraiseexcept

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/feraiseexcept
Publicfunction fegetexceptflag
func fegetexceptflag(flagp : *fexcept_t, excepts : int) : int
Attempts to obtain the full contents of the floating-point exception flags that are listed in the bitmask argument excepts, which is a bitwise OR of the floating-point exception macros. The full contents of a floating-point exception flag is not necessarily a boolean value indicating whether the exception is raised or cleared. For example, it may be a struct which includes the boolean status and the address of the code that triggered the exception. These functions obtain all such content and obtain/store it in flagp in implementation-defined format.

Parameters

  • flagp - pointer to an fexcept_t object where the flags will be stored or read from @param excepts - bitmask listing the exception flags to get/set @return 0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feexceptflag
  • excepts - bitmask listing the exception flags to get/set @return 0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feexceptflag

Returns

0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feexceptflag

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/feexceptflag
Publicfunction fesetexceptflag
func fesetexceptflag(flagp : *fexcept_t, excepts : int) : int
Attempts to copy the full contents of the floating-point exception flags that are listed in excepts from flagp into the floating-point environment. Does not raise any exceptions, only modifies the flags. The full contents of a floating-point exception flag is not necessarily a boolean value indicating whether the exception is raised or cleared. For example, it may be a struct which includes the boolean status and the address of the code that triggered the exception. These functions obtain all such content and obtain/store it in flagp in implementation-defined format.

Parameters

  • flagp - pointer to an fexcept_t object where the flags will be stored or read from @param excepts - bitmask listing the exception flags to get/set @return 0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feexceptflag
  • excepts - bitmask listing the exception flags to get/set @return 0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feexceptflag

Returns

0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feexceptflag

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/feexceptflag
Publicfunction fesetround
func fesetround(round : int) : int
Attempts to establish the floating-point rounding direction equal to the argument round, which is expected to be one of the floating-point rounding macros.

Parameters

  • round - rounding direction, one of floating-point rounding macros @return 0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feround

Returns

0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feround

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/feround
Publicfunction fegetround
func fegetround() : int
Returns the value of the floating-point rounding macro that corresponds to the current rounding direction.

Returns

the floating-point rounding macro describing the current rounding direction or a negative value if the direction cannot be determined.s @see https:en.cppreference.com/w/c/numeric/fenv/feround

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/feround
Publicfunction fegetenv
func fegetenv(envp : *fenv_t) : int
Attempts to store the status of the floating-point environment in the object pointed to by envp.

Parameters

  • envp - pointer to the object of type fenv_t which holds the status of the floating-point environment @return 0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feenv

Returns

0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feenv

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/feenv
Publicfunction fesetenv
func fesetenv(envp : *fenv_t) : int
Attempts to establish the floating-point environment from the object pointed to by envp. The value of that object must be previously obtained by a call to feholdexcept or fegetenv or be a floating-point macro constant. If any of the floating-point status flags are set in envp, they become set in the environment (and are then testable with fetestexcept), but the corresponding floating-point exceptions are not raised (execution continues uninterrupted)

Parameters

  • envp - pointer to the object of type fenv_t which holds the status of the floating-point environment @return 0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feenv

Returns

0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feenv

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/feenv
Publicfunction feholdexcept
func feholdexcept(envp : *fenv_t) : int
First, saves the current floating-point environment to the object pointed to by envp (similar to fegetenv), then clears all floating-point status flags, and then installs the non-stop mode: future floating-point exceptions will not interrupt execution (will not trap), until the floating-point environment is restored by feupdateenv or fesetenv. This function may be used in the beginning of a subroutine that must hide the floating-point exceptions it may raise from the caller. If only some exceptions must be suppressed, while others must be reported, the non-stop mode is usually ended with a call to feupdateenv after clearing the unwanted exceptions.

Parameters

  • envp - pointer to the object of type fenv_t where the floating-point environment will be stored @return 0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feholdexcept

Returns

0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feholdexcept

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/feholdexcept
Publicfunction feupdateenv
func feupdateenv(envp : *fenv_t) : int
First, remembers the currently raised floating-point exceptions, then restores the floating-point environment from the object pointed to by envp (similar to fesetenv), then raises the floating-point exceptions that were saved. This function may be used to end the non-stop mode established by an earlier call to feholdexcept.

Parameters

  • envp - pointer to the object of type fenv_t set by an earlier call to feholdexcept or fegetenv or equal to FE_DFL_ENV @return 0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feupdateenv

Returns

0 on success, non-zero otherwise. @see https:en.cppreference.com/w/c/numeric/fenv/feupdateenv

See Also

  • https:en.cppreference.com/w/c/numeric/fenv/feupdateenv