Difference between revisions of "Core.Terms.MathematicalOperations"
Jump to navigation
Jump to search
(Created page with "Category:Core == Classification == {{ClassificationActivity | MathematicalOperations | Basic mathematical operators | Term | OTX Core library | Operations...") |
|||
Line 3: | Line 3: | ||
{{ClassificationActivity | MathematicalOperations | Basic mathematical operators | [[Term]] | [[Core|OTX Core library]] | [[Operations]] | - | - }} | {{ClassificationActivity | MathematicalOperations | Basic mathematical operators | [[Term]] | [[Core|OTX Core library]] | [[Operations]] | - | - }} | ||
− | == | + | == OTL Syntax == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | NumericValue NumericTerm1 | + | NumericValue = NumericTerm1 operator NumericTerm2 |
NumericValue = - NumericTerm1 | NumericValue = - NumericTerm1 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 34: | Line 34: | ||
|} | |} | ||
− | == Examples == | + | == OTL Examples == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | Integer MyValue1; | |
− | + | Integer MyValue2; | |
− | + | Float result; | |
+ | |||
+ | result = MyValue1 + MyValue2; | ||
+ | result = MyValue1% MyValue2; | ||
+ | result = MyValue1 / MyValue2; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 04:04, 4 February 2015
Contents
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;