Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Floating-Point Guide: HP 9000 Computers

Chapter 6 Floating-Point Trap Handling

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

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:

  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” 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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997 Hewlett-Packard Development Company, L.P.