By default, trapping on floating-point exceptions
is disabled on HP 9000 systems, in accordance with the IEEE standard.
If you want your program to continue through floating-point exceptions
without trapping, it will do so automatically.
Floating-point trap handling requires two main steps:
Setting the exception trap enable bits in the floating-point
status register
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” 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”.
See “Exception Conditions” for information about IEEE exceptions. See “The PA-RISC Floating-Point Status
Register” for information about the floating-point
status register, including the exception flags and the exception
trap enable bits.