Syntax:
The /fpe:level option controls floating-point exception handling at run time for the main program. This includes whether exceptional floating-point values are allowed and how precisely run-time exceptions are reported. The /fpe:level option specifies how the compiler should handle the following floating-point exceptions:
For performance reasons:
In the visual development environment, specify the Floating-Point Exception Handling in the Floating Point Compiler Option Category. The /fpe:level (level is 0 or 3) options are as follows:
/fpe:level Option | Handling of Underflow | Handling of Divide by Zero, Overflow, and Invalid Operation |
---|---|---|
/fpe:0 (default on ia64 systems) | Sets any calculated denormalized value (result) to zero and lets the program continue. Any use of a denormalized number in an arithmetic expression uses a value of 0.0 and execution continues. A message is displayed only if /check:underflow is also specified. | Exceptional values are not allowed. The program terminates after displaying a message. |
/fpe:3 (default on ia32 systems) | Leaves any calculated denormalized value as is. The program continues, allowing gradual underflow. Use of a denormalized (or exceptional) number in an arithmetic expression results in program continuation, but with slower performance. | The program continues. No message is displayed. A NaN or Infinity (+ or -) will be generated. |
When compiling different routines in a program separately, you should use the same /fpe:level value.
On ia32 systems, the /fpe option, /check:underflow option, and MATHERRQQ routine interact as follows:
Specified /fpe:n Option |
Was /check:underflow Specified? |
Is a User-Written MATHERRQQ Routine Present? | Underflow Handling by the Visual Fortran Run-Time System on ia32 Systems |
---|---|---|---|
/fpe:0 | No | No | The underflowed result is set to zero (0). The program continues. |
/fpe:0 | No | Yes | The underflowed result is set to zero (0). The program continues. |
/fpe:0 | Yes | No | The underflowed result is set to zero (0). The program continues. The number of underflowed results are counted and messages are displayed for the first two occurrences. |
/fpe:0 | Yes | Yes | The underflowed result is set to zero (0). The program continues. The number of underflowed results are counted and messages are displayed for the first two occurrences. |
/fpe:3 | No | No | Denormalized results are allowed and the program continues. Traps are masked and no handlers are invoked. |
/fpe:3 | No | Yes | Denormalized results are allowed and the program continues. Traps are masked and no handlers are invoked. |
/fpe:3 | Yes | No | For Version 6, a fatal error results and the program terminates. |
/fpe:3 | Yes | Yes | Depends on the source causing the underflow:
|
For more information: