Classification
Name |
MathematicalOperations
|
Short Description |
Basic mathematical operators
|
Class |
Term
|
Extension |
OTX Core library
|
Group |
Operations
|
Exceptions |
-
|
Checker Rules |
-
|
Standard Compliant |
Yes
|
OTL Syntax
NumericValue = NumericTerm1 operator NumericTerm2
NumericValue = - NumericTerm1
Description
Mathematical operators are used according to the C# notation for mathematical operations. The following operators can be used:
- +
- Plus, the result is the numerical sum of two or more operands.
- -
- Minus, the result is the numerical subtraction of the left and right operands.
- -
- Negation, the result is the negated value of the operands (E.g.: -1 or Variable1).
- *
- Multiplication, the result is the numerical multiplication of two or more operands.
- /
- Div, the result is the numerical division of the left and right operands.
- %
- Modulo, that is result of the remainder of the integer division of left and right operands (applies only to type Integer).
Return Value
The Term returns the value, see table below.
|
|
In OTX, Terms are categorized according to its return data type!
|
Data Type |
Description
|
NumericValue |
Return value of mathematical operation. One operand is of type float return value is float. Otherwise, the return value of the type is integer.
|
Properties
Name |
Data Type |
Class |
Default |
Cardinality |
Description
|
NumericTerm1 |
- |
Term |
- |
[1] |
Left operand
|
NumericTerm2 |
- |
Term |
- |
[1] |
Right operand
|
OTL Examples
Integer MyValue1;
Integer MyValue2;
Float result;
result = MyValue1 + MyValue2;
result = MyValue1% MyValue2;
result = MyValue1 / MyValue2;
See also
LogicOperations
ComparativeOperations