_gfortran_set_fpe (The GNU Fortran Compiler)

#### 6.3.5 `_gfortran_set_fpe` — Enable floating point exception traps ¶

Synopsis:

  `void _gfortran_set_fpe (int val)`

Description:

  `_gfortran_set_fpe` enables floating point exception traps for the specified exceptions. On most systems, this results in a `SIGFPE` signal being sent and the program being aborted.

Arguments:

  option[0] | IEEE exceptions. Possible values are (bitwise or-ed) zero (0, default) no trapping, `GFC_FPE_INVALID` (1), `GFC_FPE_DENORMAL` (2), `GFC_FPE_ZERO` (4), `GFC_FPE_OVERFLOW` (8), `GFC_FPE_UNDERFLOW` (16), and `GFC_FPE_INEXACT` (32).

Example:

      int main (int argc, char *argv[])
      {
        /* Initialize libgfortran.  */
        _gfortran_set_args (argc, argv);
        /* FPE for invalid operations such as SQRT(-1.0).  */
        _gfortran_set_fpe (1);
        return 0;
      }