fenv

@extern
object fenv
class Object
trait Matchable
class Any
fenv.type

Type members

Inherited types

type fenv_t = CStruct0
Inherited from:
fenv (hidden)
type fexcept_t = CStruct0
Inherited from:
fenv (hidden)

Value members

Inherited methods

@name("scalanative_fe_all_except")
def FE_ALL_EXCEPT: CInt

bitwise OR of all supported floating-point exceptions

bitwise OR of all supported floating-point exceptions

Inherited from:
fenv (hidden)
@name("scalanative_fe_divbyzero")
def FE_DIVBYZERO: CInt

pole error occurred in an earlier floating-point operation

pole error occurred in an earlier floating-point operation

Inherited from:
fenv (hidden)
@name("scalanative_fe_downward")
def FE_DOWNWARD: CInt

rounding towards negative infinity

rounding towards negative infinity

Inherited from:
fenv (hidden)
@name("scalanative_fe_inexact")
def FE_INEXACT: CInt

inexact result: rounding was necessary to store the result of an earlier floating-point operation

inexact result: rounding was necessary to store the result of an earlier floating-point operation

Inherited from:
fenv (hidden)
@name("scalanative_fe_invalid")
def FE_INVALID: CInt

domain error occurred in an earlier floating-point operation

domain error occurred in an earlier floating-point operation

Inherited from:
fenv (hidden)
@name("scalanative_fe_overflow")
def FE_OVERFLOW: CInt

the result of an earlier floating-point operation was too large to be representable

the result of an earlier floating-point operation was too large to be representable

Inherited from:
fenv (hidden)
@name("scalanative_fe_tonearest")
def FE_TONEAREST: CInt

rounding towards nearest representable value

rounding towards nearest representable value

Inherited from:
fenv (hidden)
@name("scalanative_fe_towardzero")
def FE_TOWARDZERO: CInt

rounding towards zero

rounding towards zero

Inherited from:
fenv (hidden)
@name("scalanative_fe_underflow")
def FE_UNDERFLOW: CInt

the result of an earlier floating-point operation was subnormal with a loss of precision

the result of an earlier floating-point operation was subnormal with a loss of precision

Inherited from:
fenv (hidden)
@name("scalanative_fe_upward")
def FE_UPWARD: CInt

rounding towards positive infinity

rounding towards positive infinity

Inherited from:
fenv (hidden)
def feclearexcept(excepts: CInt): CInt

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.

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.

Value parameters:
excepts

bitmask listing the exception flags to clear

Returns:

​0​ if all indicated exceptions were successfully cleared or if excepts is zero. A non-zero value on error.

Inherited from:
fenv (hidden)
def fegetenv(envp: Ptr[fenv_t]): CInt
  1. Attempts to store the status of the floating-point environment in the object pointed to by envp.
Value parameters:
envp

pointer to the object of type fenv_t which holds the status of the floating-point environment

Returns:

​0​ on success, non-zero otherwise.

Inherited from:
fenv (hidden)
def fegetexceptflag(flagp: Ptr[fexcept_t], excepts: CInt): CInt

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.

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.

Value parameters:
excepts

bitmask listing the exception flags to get/set

flagp

pointer to an fexcept_t object where the flags will be stored or read from

Returns:

​0​ on success, non-zero otherwise.

Inherited from:
fenv (hidden)
def fegetround(): CInt

Returns the value of the floating-point rounding macro that corresponds to the current rounding direction.

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.

Inherited from:
fenv (hidden)
def feholdexcept(envp: Ptr[fenv_t]): CInt

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.

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.

Value parameters:
envp

pointer to the object of type fenv_t where the floating-point environment will be stored

Returns:

​0​ on success, non-zero otherwise.

Inherited from:
fenv (hidden)
def feraiseexcept(excepts: CInt): CInt

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.

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.

Value parameters:
excepts

bitmask listing the exception flags to raise

Returns:

​0​ if all listed exceptions were raised, non-zero value otherwise.

Inherited from:
fenv (hidden)
def fesetenv(envp: Ptr[fenv_t]): CInt
  1. 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)
Value parameters:
envp

pointer to the object of type fenv_t which holds the status of the floating-point environment

Returns:

​0​ on success, non-zero otherwise.

Inherited from:
fenv (hidden)
def fesetexceptflag(flagp: Ptr[fexcept_t], excepts: CInt): CInt

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.

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.

Value parameters:
excepts

bitmask listing the exception flags to get/set

flagp

pointer to an fexcept_t object where the flags will be stored or read from

Returns:

​0​ on success, non-zero otherwise.

Inherited from:
fenv (hidden)
def fesetround(round: CInt): CInt

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.

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.

Value parameters:
round

rounding direction, one of floating-point rounding macros

Returns:

​0​ on success, non-zero otherwise.

Inherited from:
fenv (hidden)
def fetestexcept(excepts: CInt): CInt

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.

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.

Value parameters:
excepts

bitmask listing the exception flags to test

Returns:

Bitwise OR of the floating-point exception macros that are both included in excepts and correspond to floating-point exceptions currently set.

Inherited from:
fenv (hidden)
def feupdateenv(envp: Ptr[fenv_t]): CInt

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.

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.

Value 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

Returns:

​0​ on success, non-zero otherwise.

Inherited from:
fenv (hidden)