public class Int extends AbstractSignedInt implements ValueType:
Represents a 32-bit signed integer.
The Int type is a value type that stores integers ranging from -2,147,483,648 to 2,147,483,647.
@example `klyn a = 42 b = Int(3.14) print(a + b) # 45
@since 1.0
| Modifier and Type | Member | Description |
|---|---|---|
| public static const | MAX_VALUEMAX_VALUE as Int = 2_147_483_647 |
The greatest value representable by an Int. |
| public static const | MIN_VALUEMIN_VALUE as Int = -2_147_483_648 |
The smallest value representable by an Int. |
| Modifier and Type | Member | Description |
|---|---|---|
| public native | IntInt() |
Builds the neutral Int value (`0`). |
| public native | Int | Conversion from a Boolean value. |
| public native | Int | Conversion from a Unicode character (returns its code point). |
| public native | Int | Conversions from double precision floating point numbers. |
| public native | Int | Conversions from floating point numbers (truncates the decimal part). |
| public native | Int | Copy constructor. |
| public native | Int | Conversion from signed 64-bit integer (Long). |
| public native | IntInt(value: String) throws BadValueException |
Parses a string into an integer. |
| public native | Int | Conversion from unsigned 32-bit integer. |
| public native | Int | Conversion from unsigned 64-bit integer. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | toStringtoString() as String: |
Returns a string representation of this integer. |
| Modifier and Type | Member | Description |
|---|---|---|
| public native static | operator!=( readonly a as Int, readonly b as Int ) as Boolean | Tests whether two Int values are different. |
| public native static | operator%( readonly a as Int, readonly b as Int ) as Int | Computes the remainder of one Int value divided by another. |
| public native static | operator%=( readonly a as Int, readonly b as Int ) as Void | Replaces `a` with the remainder of `a` divided by `b`. |
| public native static | operator*( readonly a as Int, readonly b as Int ) as Int | Multiplies two Int values. |
| public native static | operator**( readonly value as Int, readonly power as UInt ) as Int | Raises an Int value to a power. |
| public native static | operator**=( readonly value as Int, readonly power as UInt ) as Void | Replaces `value` with `value ** power`. |
| public native static | operator*=( readonly a as Int, readonly b as Int ) as Void | Multiplies `a` by `b` in place. |
| public native static | operator+( readonly a as Int, readonly b as Int ) as Int | Adds two Int values. |
| public native static | operator+=( readonly a as Int, readonly b as Int ) as Void | Adds `b` to `a` in place. |
| public native static | operator-( readonly a as Int, readonly b as Int ) as Int | Subtracts one Int value from another. |
| public native static | operator-=( readonly a as Int, readonly b as Int ) as Void | Subtracts `b` from `a` in place. |
| public native static | operator/( readonly a as Int, readonly b as Int ) as Double | Divides one Int value by another. |
| public native static | operator//( readonly a as Int, readonly b as Int ) as Int | Performs integer division on two Int values. |
| public native static | operator//=( readonly a as Int, readonly b as Int ) as Void | Replaces `a` with the integer division of `a` by `b`. |
| public native static | operator<( readonly a as Int, readonly b as Int ) as Boolean | Tests whether `a` is strictly lower than `b`. |
| public native static | operator<=( readonly a as Int, readonly b as Int ) as Boolean | Tests whether `a` is lower than or equal to `b`. |
| public native static | operator==( readonly a as Int, readonly b as Int ) as Boolean | Tests whether two Int values are equal. |
| public native static | operator>( readonly a as Int, readonly b as Int ) as Boolean | Tests whether `a` is strictly greater than `b`. |
| public native static | operator>=( readonly a as Int, readonly b as Int ) as Boolean | Tests whether `a` is greater than or equal to `b`. |