25.0 + -2.0 * 3.14159 toInt(100.0 / toFloat(3))
Integer literals like
5 will parse as type
Integer, and are not implicitly promoted to
Float, if present where a
Float is expected.
Floating point literals must have a dot, like
The basic arithmetic operations on
expression + expression expression - expression - expression expression * expression expression / expression
Multiply and divide will bind more tightly than addition and subtraction, as you would expect from the standard order of operations.
The operands to each must have the same type.
There is no implicit promotion of
Float or vice versa.
The operators will result in the same type as its inputs.
Division of two integers will result in an integer, with the remainder truncated (as is normal in, for example, C.)
Example: The following code:
5 / 2
is an integer division, and will evaluate to the
5.0 / 2.0
is a floating point division, and will evaluate to the