STE 58762 2-12
2.5 MATHEMATICAL FUNCTIONS
This section describes the mathematical functions provided by SCOL for substitution, calculation
and judgement.
With SCOL, mathematical functions can either be used independently or included in a command.
A mathematical function included in a command may be a computational expression (in which the
result of a calculation is substituted into a variable), or a logical expression (such as greater-or-less-
than constructs and true/false constructs).
Mathematical functions provided by SCOL are shown in Table 2.3.
Note that 0/0 will return a -1, and 0 ^ 0 will return a 1. One would normally expect these operations
to return an error, but be careful because they don't.
Table 2.3 Mathematical functions
Type Operand Function Example
Arithmetic
functions
^
-
*, /
+, -
MOD
=
Exponentiation
Minus sign
Multiplication, division
Addition, subtraction
Remainder
Substitution
A ^ B (A to the B power)
-A
A * B, A / B
A + B, A – B
A MOD B (The remainder when A is
divided by B.)
A = B (Puts the value of B into A.)
Relational
function
= =
< >, > <
<
>
< =, = <
> =, = >
Equal
Not equal
Less than
Greater than
Less than or equal
Greater than or equal
A = = B
A < > B, A > < B
A < B
A > B
A < = B, A = < B
A > = B, A = > B
Logical
operands
AND
OR
NOT
Logical product
Logical sum
Negation
A AND B
A OR B
NOT A
Functions SIN
COS
TAN
ASIN
ACOS
Sine
Cosine
Tangent
Arcsine
Arccosine
SIN (A)
COS (A)
TAN (A )
ASIN (A)
ACOS (A)