feupdateenv() — Save the currently raised floating-point exceptions

Standards

Standards / Extensions C or C++ Dependencies

C99
Single UNIX Specification, Version 3
C/C++ DFP
C++ TR1 C99

both  z/OS V1R8

Format

#define _ISOC99_SOURCE
#include <fenv.h>

int feupdateenv(const fenv_t *envp);

General description

feupdateenv() saves the currently raised floating-point exceptions in its automatic storage, installs the floating-point environment represented by the object pointed to by envp, and then raises the saved floating-point exceptions. envp should point to an object set by feholdexcept() or fegetenv(), or equal a floating-point environment macro.
Note: The following table shows the viable formats for these functions. See IEEE binary floating-point for more information about IEEE Binary Floating-Point.
Function Hex IEEE
feupdateenv   X
Notes:
  1. To use IEEE decimal floating-point, the hardware must have the Decimal Floating-Point Facility installed.
  2. If the hardware has the Decimal Floating-Point Facility installed, this function can update the decimal floating-point rounding mode.
  3. This function works in IEEE decimal floating-point format. See "IEEE Decimal Floating-Point" for more information.

Returned value

If successful, feupdateenv() returns 0 if the settings have been restored.

If unsuccessful, feupdateenv() returns -1 and sets one of the following errno values:

Error Code
Description
EINVAL
The rounding mode specified is not a valid Decimal Floating Point rounding mode.
EMVSERR
The function was unable to set the specified rounding mode due to an internal error.

Related information