Tests to see if a floating-point exception has occurred.
#include <float.h> #include <fpxcp.h>
int fp_invalid_op() int fp_divbyzero()
int fp_overflow() int fp_underflow()
int fp_inexact() int fp_any_xcp()
These subroutines aid in determining when an exception has occurred and the exception type. These subroutines can be called explicitly after blocks of code that may cause a floating-point exception.
The fp_invalid_op subroutine returns a value of 1 if a floating-point invalid-operation exception status flag is set. Otherwise, a value of 0 is returned.
The fp_divbyzero subroutine returns a value of 1 if a floating-point divide-by-zero exception status flag is set. Otherwise, a value of 0 is returned.
The fp_overflow subroutine returns a value of 1 if a floating-point overflow exception status flag is set. Otherwise, a value of 0 is returned.
The fp_underflow subroutine returns a value of 1 if a floating-point underflow exception status flag is set. Otherwise, a value of 0 is returned.
The fp_inexact subroutine returns a value of 1 if a floating-point inexact exception status flag is set. Otherwise, a value of 0 is returned.
The fp_any_xcp subroutine returns a value of 1 if a floating-point invalid operation, divide-by-zero, overflow, underflow, or inexact exception status flag is set. Otherwise, a value of 0 is returned.
These subroutines are part of Base Operating System (BOS) Runtime.
The fp_any_enable, fp_is_enabled, fp_enable_all, fp_enable fp_disable_all, or fp_disable subroutine, fp_clr_flag, fp_read_flag, fp_set_flag, or fp_swap_flag subroutine, fp_read_rnd or fp_swap_rnd subroutine.
Floating-Point Processor Overview in POWERstation and POWERserver Hardware Technical Information-General Architectures.
Floating-Poin t Exceptions Overview and Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.