Language: Arithmetic
Sentinel supports arithmetic operators for integers and floats. Sentinel supports sum, difference, product, quotient, and remainder.
These operators work in a typical infix style:
Order of Operations
Arithmetic follows a standard mathematical order of operations. Grouping with parentheses can be used to affect ordering.
A full table of operator precendence can be found on the boolean expressions page. This shows how arithmetic operators relate to other operators.
Integer Division
Integer division with a remainder rounds down to the nearest integer.
Example: 8 / 3 is 2
.
If the divisor is zero, an error occurs.
Mixed Numeric Operations
Mixed numeric operations between integer and floating-point values are permitted. The result is a floating-point operation with the integer converted to a floating-point value for purposes of calculation.