CRE Programmer's Guide

Math Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
7-13
Odd
Odd
The Odd function determines whether a number is even or odd. This function is not
available in the native CRE library.
number
is the number that is examined to see if it is even or odd.
Return Value
Odd returns
1 if number is odd
0 if number is even
Example
INT i;
INT(32) d := 17d;
i := RTL_Odd_Int32_(d); ! i gets 1
i := RTL_Odd_Int32_(d + 1D); ! i gets 0
Positive_Diff
The Positive_Diff functions return the arithmetic difference between two numbers if the
first number is greater than the second. If the first number is less than the second
number, the Positive_Diff functions return zero. These functions are not available in the
native CRE library.
INT PROC RTL_Odd_Int32_( number );
INT(32) number; ! in TNS only
INT PROC RTL_Positive_Diff_Int16_( x, y );
INT x, y; ! in TNS only
INT(32) PROC RTL_Positive_Diff_Int32_( x, y );
INT(32) x, y; ! in TNS only
INT(64) PROC RTL_Positive_Diff_Int64_( x, y );
INT(64) x, y; ! in TNS only
REAL(32) PROC RTL_Positive_Diff_Real32_( x, y );
REAL(32) x, y; ! in TNS only
REAL(64) PROC RTL_Positive_Diff_Real64_( x, y );
REAL(64) x, y; ! in TNS only