Difference between revisions of "Extensions.Quantities.Multiplication"

From emotive
Jump to navigation Jump to search
 
(11 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:Quantities]]
+
{{DISPLAYTITLE:'''Multiplication '''}}[[Category:Quantities]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | Multiplication | Multiplication of all numerical quantities | [[Operations]] | [[Quantities|OTX Quantities extension]] | [[Overloading semantics]] | [[InvalidConversionException]] | - }}
+
{{ClassificationActivity | Multiplication | Multiplication of all numerical quantities | [[Operations]] | [[Extensions.Quantities|OTX Quantities extension]] | [[Extensions.Quantities#Terms|Overloading semantics]] | [[Extensions.Quantities.InvalidConversionException|InvalidConversionException]] | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
QuantityTerm = QuantityTerm1 * QuantityTerm2 * ...;
+
QuantityVariable = QuantityTerm * NumericTerm;
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
This is a term wwhich returns as a result of the product of all numerical quantities (NumericQuantity) in accordance with their units.  
+
This is a term which returns as a result of the product of all numerical quantities (NumericQuantity) in accordance with their units.  
  
{{TermReturnValue| [[Quantity]] | Product of two or more numeric quantity (NumericQuantity)}}
+
* When '''Quantity''' values are multiplied, a definition of the physical dimension of the resulting '''Quantity''' has to exist in the UNIT-SPEC available to the OTX system.
 +
 
 +
* Scalar operands will be interpreted "as is"; this allows e.g. the multiplication of 2 * 2 km which will result in a '''Quantity''' of 4000 m.
 +
 
 +
* The display unit of the resulting '''Quantity''' will be set to the SI base unit corresponding to the physical dimension resulting from the operation. Furthermore, the display precision of the resulting '''Quantity''' will be the maximum of the display precisions of the operands.
 +
 
 +
{{TermReturnValue| [[Extensions.Quantities.Quantity|Quantity]] | Product of two or more numeric quantity (NumericQuantity)}}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| QuantityTerm1 | [[Quantity]] | [[Term]] | - | [1] | NumericQuantity operand, which should be multiplied}}
+
{{TableRowPropertie1| QuantityTerm | [[Extensions.Quantities.Quantity|Quantity]] | [[Term]] | - | [1..*] | Quantity values are multiplied}}
{{TableRowPropertie1| QuantityTerm2 | [[Quantity]] | [[Term]] | - | [1] | NumericQuantity operand, which should be multiplied}}
+
{{TableRowPropertie2| NumericTerm| [[Numeric]] | [[Term]] | - | [0..*] | Numeric values are multiplied}}
 
|}
 
|}
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Quantities.Quantity Quantity1;
+
/// Local Declarations
 +
 
 +
Quantities.Quantity Quantity;
 +
 
 +
/// Flow
  
Quantity1 = 1 [@Unit, "ODX_RS_UNIT_LIB.odx", "km"] * 500 [@Unit, "ODX_RS_UNIT_LIB.odx", "m"];
+
Quantity = 2 * 2 [@Unit, "BL_DataLibraMIB.odx", "km", 2];
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== See also ==
 
== See also ==
[[Addition]] <br/>
+
[[Extensions.Quantities.Addition|Addition]] <br/>  
[[Subtraction]] <br/>
+
[[Extensions.Quantities.Subtraction|Subtraction]] <br/>
[[Division]]
+
<!--[[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/>

Latest revision as of 03:13, 13 September 2019

Classification

Name Multiplication
Short Description Multiplication of all numerical quantities
Class Operations
Extension OTX Quantities extension
Group Overloading semantics
Exceptions InvalidConversionException
Checker Rules -
Standard Compliant Yes

OTL Syntax

QuantityVariable = QuantityTerm * NumericTerm;

Description

This is a term which returns as a result of the product of all numerical quantities (NumericQuantity) in accordance with their units.

  • When Quantity values are multiplied, a definition of the physical dimension of the resulting Quantity has to exist in the UNIT-SPEC available to the OTX system.
  • Scalar operands will be interpreted "as is"; this allows e.g. the multiplication of 2 * 2 km which will result in a Quantity of 4000 m.
  • The display unit of the resulting Quantity will be set to the SI base unit corresponding to the physical dimension resulting from the operation. Furthermore, the display precision of the resulting Quantity will be the maximum of the display precisions of the operands.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Quantity Product of two or more numeric quantity (NumericQuantity)

Properties

Name Data Type Class Default Cardinality Description
QuantityTerm Quantity Term - [1..*] Quantity values are multiplied
NumericTerm Numeric Term - [0..*] Numeric values are multiplied

OTL Examples

/// Local Declarations

Quantities.Quantity Quantity;

/// Flow

Quantity = 2 * 2 [@Unit, "BL_DataLibraMIB.odx", "km", 2];

See also

Addition
Subtraction
Division
Modulo
Absolute Value
Negation