company logo

numeric type operation

Numeric type operations support arithmetical, comparison, logical and assignment operations.

Comparing two numbers is done based on the numeric type of the first operand. Thus, comparing an integer value with a float value might return equal, even though the float value is not exactly the same, because the float value will be converted into integer before comparing.

Logical operations with numbers will convert both operands into Boolean values before performing the operation.

Arithmetical operations are performed with the precision defined for the first operand. This may lead to rounding errors when operating on values with different precision.

Generalisations:  type operation