Reference Manual

Turbo PMAC/PMAC2 Software Reference
Turbo PMAC Mathematical Features 486
TURBO PMAC MATHEMATICAL FEATURES
Mathematical Operators
+
Function: Addition
The + sign implements the addition of the numerical values preceding and following it.
Multiplication, division, modulo (remainder), and bit-by-bit and operations have higher priority than
addition, subtraction, bit-by-bit or, and bit-by-bit exclusive-or operations. Operations of the same priority
are implemented from left to right.
The + sign may not be used as a unary operator to emphasize that the positive value of the following
variable or constant is to be used (e.g. P1=+P2). This syntax will be rejected with an error.
Execution time, 80 MHz CPU: 2.9 µsec interpreted, 1.2 µsec compiled floating-point, 0.08 µsec compiled
fixed-point.
-
Function: Subtraction, negation
The - sign implements the subtraction of the numerical value following it from the numerical value
preceding it. If there is no numerical value preceding it, it causes the negation of the numerical value
following it.
Multiplication, division, modulo (remainder), and bit-by-bit and operations have higher priority than
addition, subtraction, bit-by-bit or, and bit-by-bit exclusive-or operations. Operations of the same priority
are implemented from left to right.
Execution time, 80 MHz CPU: 2.9 µsec interpreted, 1.2 µsec compiled floating-point, 0.08 µsec compiled
fixed-point
*
Function: Multiplication
The * sign implements the multiplication of the numerical values preceding and following it.
Multiplication, division, modulo (remainder), and bit-by-bit and operations have higher priority than
addition, subtraction, bit-by-bit or, and bit-by-bit exclusive-or operations. Operations of the same priority
are implemented from left to right.
Execution time, 80 MHz CPU: 3.0 µsec interpreted, 1.0 µsec compiled floating-point, 0.13 µsec compiled
fixed-point
/
Function: Division
The / sign implements the division of the numerical value preceding it by the numerical value following
it. Unless the division is executed in a compiled PLC on a line with only L-variables and integers, the
division operation is always a floating-point calculation (even if integer values are used). The quotient is
computed as a floating-point value and used as such in subsequent calculations in the same expression; if
it is then stored to an integer, it is rounded at the time of storage.
If the division operation is performed as an integer operation in a compiled PLC (only L-variables and
integer constants on the line), the quotient is computed as an integer (rounded to the nearest integer value)
and used as such in subsequent calculations in the same expression.
Multiplication, division, modulo (remainder), and bit-by-bit and operations have higher priority than
addition, subtraction, bit-by-bit or, and bit-by-bit exclusive-or operations. Operations of the same priority
are implemented from left to right.