Int

Int is a value type that can store a signed, 32-bit integer. That is, a whole number between -2147483648 and 2147483647.

If you need to store a number with a fractional component, use Float instead.

Overflow

Integer arithmetic does not overflow, but is clamped to between Int.Min and Int.Max.

Literal syntax

An Int literal can be written directly.

property Int bankBalance: 0
property Int count: -12
property Int ulimateAnswer: 42

function format(String formatPattern) → String

Returns the integer formatted as a string using the format pattern.

The format pattern is explained in Float.format().

static function Int.random(Int min, Int max) → Int

Returns a random integer between min and max in the range [min, max).

static property Int Int.Minread only: -2147483648

static property Int Int.Maxread only: 2147483647

The minimum and maximum values representable by the Int type.