int
64-bit signed integers.
Constructor
Calling int converts a value to an integer.
Errors: Raises an error if the value cannot be converted (e.g. nil or
a non-numeric string).
Operators
Arithmetic
| Operator | Description | Result |
|---|---|---|
+ |
Addition | int |
- |
Subtraction | int |
* |
Multiplication | int |
/ |
Division | float |
// |
Euclidean (integer) division | int |
% |
Euclidean remainder | int |
-x |
Negation | int |
/ always produces a float. // and % satisfy the identity
x == (x // y) * y + (x % y).
Bitwise
| Operator | Description |
|---|---|
& |
AND |
\| |
OR |
^ |
XOR |
~x |
NOT |
<< |
Left shift |
>> |
Right shift |
Comparison
==, !=, <, >, <=, >=
Mixed int/float comparisons are supported.