Difference between revisions of "Core.Terms.Modulo"
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:OTX '''MathematicalOperations'''}}Category:Core Please see MathematicalOperations.") |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{DISPLAYTITLE:OTX ''' | + | {{DISPLAYTITLE:OTX '''Modulo'''}}[[Category:Core]] |
− | + | == Classification == | |
+ | {{ClassificationActivity | Modulo | Returns the remainder of a division | [[Term]] | [[Core|OTX Core library]] | [[Operations]] | - | - }} | ||
+ | |||
+ | == OTL Syntax == | ||
+ | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | NumericValue = NumericTerm1 % NumericTerm2; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | == Description == | ||
+ | Modulo is a NumericTerm which returns the remainder of a division. The following operator can be used: '''%''' | ||
+ | |||
+ | {{TermReturnValue| [[Integer]], [[Float]] | The remainder of a division of the two operands. If one or more operands is of type float, the return value is float. Otherwise, the return value of the type is integer.}} | ||
+ | |||
+ | == Properties == | ||
+ | {| {{TableHeader}} | ||
+ | {{TableRowPropertiesHeader}} | ||
+ | {{TableRowPropertie1| Numeral | [[Integer]], [[Float]] | [[Term]] | - | [1] | A numeric term which represents the dividend value}} | ||
+ | {{TableRowPropertie2| Divisor | [[Integer]], [[Float]] | [[Term]] | - | [1] | A numeric term which represents the divisor value}} | ||
+ | |} | ||
+ | |||
+ | == OTL Examples == | ||
+ | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | /// Local Declarations | ||
+ | |||
+ | Integer MyValue1 = 1; | ||
+ | Integer MyValue2 = 5; | ||
+ | Integer Result1; | ||
+ | Float Result2; | ||
+ | |||
+ | /// Flow | ||
+ | |||
+ | Result1 = 17 % MyValue1; | ||
+ | Result2 = 17.5 % MyValue2; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | == See also == | ||
+ | [[Core.Terms.Add|Add]] <br/> | ||
+ | [[Core.Terms.Subtract|Subtract]] <br/> | ||
+ | [[Core.Terms.Multiply|Multiply]] <br/> | ||
+ | [[Core.Terms.Divide|Divide]] <br/> | ||
+ | <!--[[Core.Terms.Modulo|Modulo]] <br/>--> | ||
+ | [[Extensions.Quantities.Modulo|Quantities Modulo]] <br/> | ||
+ | [[Core.Terms.AbsoluteValue|AbsoluteValue]] <br/> | ||
+ | [[Core.Terms.Round|Round]] <br/> | ||
+ | [[Core.Terms.Negate|Negate]] |
Latest revision as of 07:23, 24 June 2019
Contents
Classification
Name | Modulo |
Short Description | Returns the remainder of a division |
Class | Term |
Extension | OTX Core library |
Group | Operations |
Exceptions | - |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
NumericValue = NumericTerm1 % NumericTerm2;
Description
Modulo is a NumericTerm which returns the remainder of a division. The following operator can be used: %
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Integer, Float | The remainder of a division of the two operands. If one or more operands is of type float, the return value is float. Otherwise, the return value of the type is integer. |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Numeral | Integer, Float | Term | - | [1] | A numeric term which represents the dividend value |
Divisor | Integer, Float | Term | - | [1] | A numeric term which represents the divisor value |
OTL Examples
/// Local Declarations
Integer MyValue1 = 1;
Integer MyValue2 = 5;
Integer Result1;
Float Result2;
/// Flow
Result1 = 17 % MyValue1;
Result2 = 17.5 % MyValue2;
See also
Add
Subtract
Multiply
Divide
Quantities Modulo
AbsoluteValue
Round
Negate