User's Manual

PMAC User Manual
Computational Features 155
Logical Operators
PMAC has three logical operators that do bit-by-bit operations: & (bit-by-bit AND), | (bit-by-bit OR), and
^ (bit-by-bit EXCLUSIVE OR). If floating-point numbers are used, the operation works on the fractional
as well as the integer bits. & has the same precedence as * and /; | and ^ have the same precedence as +
and -. Use of parentheses can override this default precedence.
Note:
Bit-by-bit logical operators differ from the simple Boolean operators AND and OR
used in compound conditions (q.v.).
Functions
These perform mathematical operations on constants or expressions to yield new values. The general
format is:
{function name} ({expression})
The available functions are SIN, COS, TAN, ASIN, ACOS, ATAN, ATAN2, SQRT, LN, EXP, ABS, and
INT.
Note:
The global I-variable I15 controls whether the units for the trigonometric functions
are degrees or radians.
SIN
Function
standard trigonometric sine function.
Syntax
SIN ({expression})
Domain
All real numbers
Domain units
none
Range
-1.0 — 1.0
Range units
none
Possible errors
none
COS
Function
standard trigonometric cosine function.
Syntax
COS ({expression})
Domain
All real numbers
Domain units
radians/degrees
Range
-1.0 — 1.0
Range units
none
Possible errors
none
TAN
Function
standard trigonometric tangent function
Syntax
TAN ({expression})
Domain
all real numbers except +/- Pi/2, 3Pi/2, 5Pi/2...
Domain units
radians/degrees
Range
all real
Range units
none
Possible errors
Divide by zero on illegal domain (may just return
maximum real value instead).