Returns and clears theaccumulated math error status.
message_inhibit (optional) Disables or enables the printing of math error exception error messages when they are detected. By default, these messages are enabled. Set message_inhibit to 1 to inhibit, and 0 to re-enable.
When the interpreter exits to the interactive mode, error messages are printed for accumulated math errors that were suppressed but not cleared.
CAUTION: On machines that do not implement the IEEE standard for floating-point math, CHECK_MATH does not properly maintain an accumulated error status.
NOTE: Trap handling is machine dependent. Some machines won't work properly with traps enabled, while others don't allow disabling traps.
CAUTION: Not all machines detect all errors.
a = [1.0, 1.0, 2.0]
a
will not fail as divisor.
b = [1.0, 0.0, 2.0]
b
should cause a divide-by-zero error.
junkstatus = CHECK_MATH(1, 0, Trap=1)
c = 1.0 / a status = CHECK_MATH(0, 0) PRINT, a, c, status
1.00000 1.00000 2.00000
1.00000 1.00000 0.500000
0
d = 1.0 / b
% Program caused arithmetic error:
% Floating divide by 0
% Detected at $MAIN$ .
status = CHECK_MATH(0, 0) PRINT, b, d, status
1.00000 0.00000 2.00000
1.00000 Inf 0.500000
16
For additional information on error handling, see the PV-WAVE Programmer's Guide.