TAL Reference Manual

Expressions
TAL Reference Manual526371-001
4-18
Special Expressions
For example, the following operations turn on the overflow indicator (and interrupt the
system overflow trap handler if the overflow trap is armed through ENV.T):
Division by 0
Floating-point arithmetic result in which the exponent is too large or too small
Signed arithmetic result that exceeds the number of bits allowed by the data type
of the expression
For overflowed integer addition, subtraction, or negation, the result is truncated. For
overflowed multiplication, division, or floating-point operation, the result is undefined.
A program can deal with arithmetic overflows in one of four ways:
For more information on turning off overflow trapping and using $OVERFLOW, see the
description of the $OVERFLOW function in Section 14, Standard Functions
.
The following operations are not portable to future software platforms:
Passing the overflow bit as an implicit parameter into a procedure or subprocedure
Returning the overflow bit as an implicit result from a procedure or subprocedure
Special Expressions
Special expressions allow you to perform specialized arithmetic or conditional
operations. Table 4-12
on page 4-19 summarizes these special expressions.
Type conversions On, off, or preserved
Array indexing and extended structure addressing Undefined
Assignment or shift operation Preserved
Desired Effect Method
Abort on all overflows Use the system’s default trap handler.
Recover globally from overflows Use a user-supplied trap handler.
Recover locally from statement
overflows
Turn off overflow trapping and use $OVERFLOW.
Ignore all overflows Turn off overflow trapping throughout the program.
Operation Overflow Indicator