These subroutines allow operations on the floating-point trap control.
Standard C Library (libc.a)
#include <fptrap.h>
int fp_any_enable()
int fp_is_enabled( Mask)
fptrap_t Mask;
void fp_enable_all()
void fp_enable(Mask)
fptrap_t Mask;
void fp_disable_all()
void fp_disable(Mask)
fptrap_t Mask;
Floating point traps must be enabled before traps can be generated. These subroutines aid in manipulating floating-point traps and identifying the trap state and type.
In order to take traps on floating point exceptions, the fp_trap subroutine must first be called to put the process in serialized state, and the fp_enable subroutine or fp_enable_all subroutine must be called to enable the appropriate traps.
The header file fptrap.h defines the following names for the individual bits in the floating-point trap control:
Item | Description |
---|---|
TRP_INVALID | Invalid Operation Summary |
TRP_DIV_BY_ZERO | Divide by Zero |
TRP_OVERFLOW | Overflow |
TRP_UNDERFLOW | Underflow |
TRP_INEXACT | Inexact Result |
Item | Description |
---|---|
Mask | A 32-bit pattern that identifies floating-point traps. |
The fp_any_enable subroutine returns 1 if any floating-point traps are enabled. Otherwise, 0 is returned.
The fp_is_enabled subroutine returns 1 if the floating-point traps specified by the Mask parameter are enabled. Otherwise, 0 is returned.
The fp_enable_all subroutine enables all floating-point traps.
The fp_enable subroutine enables all floating-point traps specified by the Mask parameter.
The fp_disable_all subroutine disables all floating-point traps.
The fp_disable subroutine disables all floating-point traps specified by the Mask parameter.