Integer division
It is frequently expected that the result of the division of two integers is a floating point number. To achieve this result either the dividend or the divisor is to be converted to a double (see asDouble).
<Integer1> / <Integer2> | |||
---|---|---|---|
Expressions | Integer | Integer1 | Arithmetic operator |
Integer | Integer2 | Arithmetic operator | |
Return value | Integer |
Formula | Result |
---|---|
= 4/2 | 2 |
= 8/3 | 2 |
=-7/2 | -3 |
=asDouble(8)/3 | 2.6666666666666665 |
=8/asDouble(3) | 2.6666666666666665 |