Int
class in package klyn

    public class Int extends AbstractSignedInt implements ValueType:

Object
└ AbstractNumber
└ AbstractInt
└ AbstractSignedInt
└ Int
All Implemented Interfaces: 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

    a = 42
    b = Int(3.14)
    print(a + b) # 45

Fields

Modifier and Type | Member | Description
--- | --- | ---
public static const | MAX_VALUE `MAX_VALUE as Int = 2_147_483_647` | The greatest value representable by an Int.
public static const | MIN_VALUE `MIN_VALUE as Int = -2_147_483_648` | The smallest value representable by an Int.

Inherited Properties
property Inherited Properties from Object: type
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public native | Int `Int()` | Builds the neutral Int value (`0`).
public native | Int `Int(value: Boolean)` | Conversion from a Boolean value.
public native | Int `Int(value: Char)` | Conversion from a Unicode character (returns its code point).
public native | Int `Int(value: Double)` | Conversions from double precision floating point numbers.
public native | Int `Int(value: Float)` | Conversions from floating point numbers (truncates the decimal part).
public native | Int `Int(value: Int)` | Copy constructor.
public native | Int `Int(value: Long)` | Conversion from signed 64-bit integer (Long).
public native | Int `Int(value: String) throws ValueException` | Parses a string into an integer.
public native | Int `Int(value: UInt)` | Conversion from unsigned 32-bit integer.
public native | Int `Int(value: ULong)` | Conversion from unsigned 64-bit integer.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public override | toString `toString() as String:` | Returns a string representation of this integer.

Inherited Methods
method Inherited Methods from Object: deepCopy, fromJson, toDict, toJson, toString, toXml
Operators

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`.