5.3.2. Multiplicative Arithmetic Term

[Tip]Description

A multiplicative arithmetic term is an ASM term constituted from applying the multiply, divide or remainder operators.

[Important]Syntax
MultArithmeticTermAST ::= UnaryArithmeticTermAST
                        | MultArithmeticTermAST * UnaryArithmeticTermAST
                        | MultArithmeticTermAST / UnaryArithmeticTermAST
                        | MultArithmeticTermAST % UnaryArithmeticTermAST

A multiplicative arithmetic term is composed of unary arithmetic terms with a multiply (*), divide (/) or remainder (%) operators.

[Note]Semantics

The evaluation of multiplicative arithmetic terms are evaluated according to Table 2.8, “Multiply (*) and Divide (/) operators ” and Table 2.9, “Remainder (%) 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.8. Multiply (*) and Divide (/) operators

 UndefBooleanStringIntegerDoubleModelElementMultiplicity
UndefUndefUndefUndefUndefUndefUndefUndef
BooleanUndef      
StringUndef      
IntegerUndef  IntDouble  
DoubleUndef  DoubleDouble  
ModelElementUndef      
MultiplicityUndef      


Table 2.9. Remainder (%) operator

 UndefBooleanStringIntegerDoubleModelElementMultiplicity
UndefUndefUndefUndefUndefUndefUndefUndef
BooleanUndef      
StringUndef      
IntegerUndef  Int   
DoubleUndef      
ModelElementUndef      
MultiplicityUndef      


[Warning]Warning

Note that the evaluation rules of arithmetic operators changed in the new release to be compliant with its use in Java.

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:  arithmetic term