Floating Point Exceptions
A fp status register flag is set when fpu is has an illegal condition:
- division by zero
By default, all exceptions are ignored!
(e.g. for 1/0 NaN value is set and execution continues)
The status register can be programmed to raise a Floating Point Exception.
If an FPE occurs, the system can take a specified action:
- ignore the exception
- repair the illegal condition
You can manipulate the status register to select action:
- with calls to the FPE library, link with -lfpe
- with environment variable TRAP_FPE