5.3.3. Unary Arithmetic Term

[Tip]Description

A unary arithmetic term is an ASM term constituted from negation and minus operators.

[Important]Syntax
UnaryArithmeticTermAST ::= BaseArithmeticTermAST  
                        | - BaseArithmeticTermAST  
                        | ! BaseArithmeticTermAST   

A unary arithmetic term is composed of base arithmetic terms with a negation (!) and the (unary) minus (-) operators.

[Note]Semantics

The evaluation of unary arithmetic terms are evaluated according to Table 2.10, “Negation (!) operator ” and Table 2.11, “Minus (-) operator ”, which shows the type of the output with respect to the types of each operand.

If any operation has an undef value among its operands, the result is always undef, no matter what the type of the other operand is.

Table 2.10. Negation (!) operator

UndefBooleanStringIntegerDoubleModelElementMultiplicity
UndefBool     


Table 2.11. Minus (-) operator

UndefBooleanStringIntegerDoubleModelElementMultiplicity
Undef  IntDouble  


Remark.  There is no implicit type casting on the input of the operands; conversion operators have to be used if casting is required.

Defined In:  multiplicative arithmetic term