Difference between revisions of "Extensions.Quantities.Division"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
{{DISPLAYTITLE:'''Division '''}}[[Category:Quantities]] | {{DISPLAYTITLE:'''Division '''}}[[Category:Quantities]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | Division | Division two numeric quantities | [[Operations]] | [[Extensions.Quantities|OTX Quantities extension]] | [[Overloading semantics]] | [[ | + | {{ClassificationActivity | Division | Division two numeric quantities | [[Operations]] | [[Extensions.Quantities|OTX Quantities extension]] | [[Extensions.Quantities#Terms|Overloading semantics]] | [[Extensions.Quantities.InvalidConversionException|InvalidConversionException]] | - }} |
== OTL Syntax == | == OTL Syntax == | ||
Line 10: | Line 10: | ||
== Description == | == Description == | ||
This is a term wwhich returns as a result of the Division two numeric quanity (NumericQuantity) in accordance with their units. | This is a term wwhich returns as a result of the Division two numeric quanity (NumericQuantity) in accordance with their units. | ||
+ | |||
+ | * When '''Quantity''' values are divided, a definition of the physical dimension of the resulting '''Quantity''' has to exist in the UNIT-SPEC available to the OTX system. | ||
+ | |||
+ | * Scalar operands shall be interpreted "as is"; this allows e.g. the multiplication of 2 km / 2 which will result in a '''Quantity''' of 1000 m. | ||
+ | |||
+ | * The display unit of the resulting '''Quantity''' should be set to the SI base unit corresponding to the physical dimension resulting from the operation. Furthermore, the display precision of the resulting '''Quantity''' shall be the maximum of the display precisions of the operands. | ||
{{TermReturnValue| [[Extensions.Quantities.Quantity|Quantity]] | The result of dividing two numeric quanity (NumericQuantity)}} | {{TermReturnValue| [[Extensions.Quantities.Quantity|Quantity]] | The result of dividing two numeric quanity (NumericQuantity)}} | ||
Line 22: | Line 28: | ||
== OTL Examples == | == OTL Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | Quantities.Quantity | + | Quantities.Quantity Quantity; |
+ | |||
+ | /// Flow | ||
− | + | Quantity = 2 [@Unit, "BL_DataLibraMIB.odx", "km", 2]/2; | |
</syntaxhighlight> | </syntaxhighlight> | ||
== See also == | == See also == | ||
− | [[Extensions.Quantities.Addition|Addition]] <br/> | + | [[Extensions.Quantities.Addition|Addition]] <br/> |
[[Extensions.Quantities.Subtraction|Subtraction]] <br/> | [[Extensions.Quantities.Subtraction|Subtraction]] <br/> | ||
− | [[Extensions.Quantities.Multiplication|Multiplication]] | + | [[Extensions.Quantities.Multiplication|Multiplication]] <br/> |
+ | <!--[[Extensions.Quantities.Division|Division]]<br/>--> | ||
+ | [[Extensions.Quantities.Modulo|Modulo]]<br/> | ||
+ | [[Extensions.Quantities.AbsoluteValue|Absolute Value]]<br/> | ||
+ | [[Extensions.Quantities.Negation|Negation]]<br/> |
Revision as of 07:54, 2 October 2018
Contents
Classification
Name | Division |
Short Description | Division two numeric quantities |
Class | Operations |
Extension | OTX Quantities extension |
Group | Overloading semantics |
Exceptions | InvalidConversionException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
QuantityTerm = QuantityTerm1 / QuantityTerm2;
Description
This is a term wwhich returns as a result of the Division two numeric quanity (NumericQuantity) in accordance with their units.
- When Quantity values are divided, a definition of the physical dimension of the resulting Quantity has to exist in the UNIT-SPEC available to the OTX system.
- Scalar operands shall be interpreted "as is"; this allows e.g. the multiplication of 2 km / 2 which will result in a Quantity of 1000 m.
- The display unit of the resulting Quantity should be set to the SI base unit corresponding to the physical dimension resulting from the operation. Furthermore, the display precision of the resulting Quantity shall be the maximum of the display precisions of the operands.
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Quantity | The result of dividing two numeric quanity (NumericQuantity) |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
QuantityTerm1 | Quantity | Term | - | [1] | Left operand is of type NumericQuantity |
QuantityTerm2 | Quantity | Term | - | [1] | Right operand is of type NumericQuantity |
OTL Examples
Quantities.Quantity Quantity;
/// Flow
Quantity = 2 [@Unit, "BL_DataLibraMIB.odx", "km", 2]/2;
See also
Addition
Subtraction
Multiplication
Modulo
Absolute Value
Negation