Difference between revisions of "Extensions.Quantities.Negation"

From emotive
Jump to navigation Jump to search
Line 5: Line 5:
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
/// Local Declarations
 
Quantities.Quantity QuantityVariable;
 
/// Flow
 
 
QuantityVariable = Negate(QuantityTerm);
 
QuantityVariable = Negate(QuantityTerm);
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 10:51, 7 November 2018

Classification

Name Negation
Short Description Returns the value of the numeric quantity with inverted sign
Class Operations
Extension OTX Quantities extension
Group Overloading semantics
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

QuantityVariable = Negate(QuantityTerm);

Description

When the negation is computed from a Quantity, the display unit of the resulting Quantity should be set to the SI base unit corresponding to the physical dimension of the original Quantity. Furthermore, the display precision of the resulting Quantity shall be equal to the display precision of the original Quantity. First the computation to SI Unit is done, and secondly the math function is calculated.

Example: -(-10°C) transform to SI -(263 K) Result: -263 K


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 The result of the negation of a numeric quantity (NumericQuantity)

Properties

Name Data Type Class Default Cardinality Description
QuantityTerm Quantity Term - [1] The numeric Quantity term whose negation shall be returned

OTL Examples

/// Local Declarations

Quantities.Quantity Quantity;

/// Flow

Quantity = Negate(-10 [@Unit, "BL_DataLibraMIB.odx", "°C"]);

See also

Addition
Subtraction
Multiplication
Division
Modulo
Absolute Value