The TEST statement has the following form:

TEST arithmetic-expression,alt-neg,alt-zero,alt-pos

In the first form, it takes the first alternative if the arithmetic expression is negative, the second if it is zero, and the third if it is positive.

The COMPARE Statement has the following form:

COMPARE arithmetic-expression:arithmetic-expression,alt-less,alt-equal,alt-greater

This statement is equivalent to

TEST (arithmetic-expression)-(arithmetic-expression),alt-neg,alt-zero,alt-pos

only if the subtraction does not result in an overflow; the COMPARE statement is guaranteed to select the correct alternative even if the subtraction of the values of the two arithmetic expressions would result in an overflow, whether fixed-point or floating-point.

[Next] [Up] [Previous]