t can be one of the following values.
Table A–14 The -ftrap Values
Value |
Meaning |
---|---|
[no%]division |
[Do not] Trap on division by zero. |
[no%]inexact |
[Do not] Trap on inexact result. |
[no%]invalid |
[Do not] Trap on invalid operation. |
[no%]overflow |
[Do not] Trap on overflow. |
[no%]underflow |
[Do not] Trap on underflow. |
%all |
Trap on all of the above. |
%none |
Trap on none of the above. |
common |
Trap on invalid, division by zero, and overflow. |
Note that the [no%] form of the option is used only to modify the meaning of the %all and common values, and must be used with one of these values, as shown in the example. The [no%] form of the option by itself does not explicitly cause a particular trap to be disabled.
If you do not specify –ftrap, the compiler assumes –ftrap=%none.
–ftrap=%all,no%inexact means to set all traps except inexact.
If you compile one routine with –ftrap=t, compile all routines of the program with the same -ftrap=t option; otherwise, you might get unexpected results.
Use the -ftrap=inexact trap with caution. Use of– ftrap=inexact results in the trap being issued whenever a floating-point value cannot be represented exactly. For example, the following statement generates this condition:
x = 1.0 / 3.0; |
This option is effective only if used when compiling the main program. Be cautious when using this option. If you wish to enable the IEEE traps, use –ftrap=common.
ieee_handler(3M), fex_set_handling(3M) man pages.