Exception Parameters

An exception is disabled if its bit is set to 1 and enabled if its bit is cleared to 0. If an exception is disabled (exceptions can be disabled by setting the flags to 1 with SETCONTROLFPQQ (ia32 only)), it will not generate an interrupt signal if it occurs. The floating-point process will return an appropriate special value (for example, NaN or signed infinity), but the program continues. You can find out which exceptions (if any) occurred by calling GETSTATUSFPQQ (ia32 only).

If errors on floating-point exceptions are enabled (by clearing the flags to 0 with SETCONTROLFPQQ (ia32 only)), the operating system generates an interrupt when the exception occurs. By default these interrupts cause run-time errors, but you can capture the interrupts with SIGNALQQ and branch to your own error-handling routines.

You should remember not to clear all existing settings when changing one. The values you want to change should be combined with the existing control word in an inclusive-OR operation (OR, IOR, .OR.) if you do not want to reset all options. For example:

  USE DFLIB
  INTEGER(2) control, newcontrol
  CALL GETCONTROLFPQQ(control)
  newcontrol = (control .OR. FPCW$INVALID)
  ! Invalid exception set (disabled).
  CALL SETCONTROLFPQQ(newcontrol)