HP-UX Floating-Point Guide
152 Chapter 6
Floating-Point Trap Handling
Floating-point trap handling requires two main steps:
1. Setting the exception trap enable bits in the floating-point status
register
2. Defining the action to be taken when the trap occurs
Both steps vary somewhat from language to language on HP-UX
systems. In this section we suggest some methods of enabling and
handling traps in Fortran and C.
In C, you can also use the exception flags in the floating-point status
register to detect exceptions without taking a trap. See “Detecting
Exceptions without Enabling Traps” on page 164 for details.
If your code handles integer arithmetic as well as floating-point
arithmetic, you may encounter an integer exception. We discuss integer
exceptions briefly in “Handling Integer Exceptions” on page 165.
See “Exception Conditions” on page 53 for information about IEEE
exceptions. See “The PA-RISC Floating-Point Status Register” on
page 128 for information about the floating-point status register,
including the exception flags and the exception trap enable bits.