HP-UX Floating-Point Guide
Chapter 5 127
Manipulating the Floating-Point Status Register
Run-Time Mode Control: The fenv(5) Suite
Run-Time Mode Control: The fenv(5)
Suite
This section describes the fenv(5) suite of functions, a collection of
services provided in the C math library that allow an application to
manipulate several modifiable control mode and status flags in the
floating-point status register. These functions and their associated
parameter types are declared in the header file /usr/include/fenv.h.
NOTE The fenv(5) suite replaces the fpgetround(3M) suite of functions.
You can call these functions from Fortran programs. See “A Program
Example” on page 109 for examples.
The fenv(5) suite contains the following functions:
• fegetenv and fesetenv, which retrieve and set the floating-point
environment
• feholdexcept and feupdateenv, which can be used to hide
spurious exceptions
• fegetexceptflag and fesetexceptflag, which retrieve and set
the accrued exception flags
• feraiseexcept, fetestexcept, and feclearexcept, which raise,
test, and clear exceptions
• fegetround and fesetround, which retrieve and set the rounding
mode
• fegettrapenable and fesettrapenable, which retrieve and set
the exception trap enable bits
• fegetflushtozero and fesetflushtozero, which retrieve and
set the underflow mode
All of these functions except the last four (fegettrapenable,
fesettrapenable, fegetflushtozero, and fesetflushtozero)
have been included in the C9X draft standard by the ANSI/ISO C
committee.