Skip to content

Int

128-bit signed integers.

The rounding methods return the receiver unchanged.

Inherits from: Num

Constructor

Int()

Int accepts an integer, a boolean, or an integral float. It rejects fractional floats and interpretive conversions such as parsing strings.

assert_eq (Int true) 1
assert_eq (Int 3.0) 3

The lowercase int function performs coercion and parsing:

assert_eq (int "42") 42
assert_eq (int 3.14) 3

Class Fields

MAX

Largest representable integer.

MIN

Smallest representable integer.

Methods

(band) other

Computes bitwise AND.

(bnot)()

Computes bitwise NOT.

(bor) other

Computes bitwise OR.

(bxor) other

Computes bitwise XOR.

(shl) other

Shifts left.

(shr) other

Shifts right arithmetically, sign-extending negative values.