class Int
class UInt
A generic integer class, either signed or unsigned able to represent virtually infinitely large numbers (limited only by memory) and the default type for any integer literal.
Note that being unrestricted has a performance impact on the class. For performance critical code the use of sized integer types is suggested.
self + other:Int self - other:Int self * other:Int self // other:Int self ** other:IntAll standard mathematical operations except normal division are supported by this class.self:RealInts may be implicitly cast to real numbers, resulting in normal divisions of integers returning reals.self as Int8 self as Int16 self as Int32 self as Int64 self as Int128Ints may be explicitly cast to any sized integer type, possibly resulting in an exception if the size of the integer is larger than the requested type.self as Byte[]The underlying representation can be obtained by explicitly casting to a Byte array.self as UIntThe Int class may be explicitly cast to UInt. If the number is negative an exception is thrown.self:IntThe UInt class may be implicitly cast to Int.
class Real
class UReal
A generic real number class is an arbitrary precision floating point number and the default type for any real number literal.
self + other:Real self - other:Real self * other:Real self / other:Real self ** other:RealAll standard mathematical operations except integer division are supported by this class.self as Float32 self as Float64Any real may be cast to any sized floating point type.self as IntAny real may also be explicitly cast to an integer. The resulting integer is guaranteed to be rounded to the correct integer number. May result in an exception if the real is too large.self as Byte[]The underlying representation can be obtained by explicitly casting to a Byte array.
class Int8
class Int16
class Int32
class Int64
class Int128
class UInt8
class UInt16
class UInt32
class UInt64
class UInt128
Each IntXXX and UIntXXX class is a direct mapping to integers (signed or unsigned) of XXX number of bits. Operations with these types are typically single instructions and thereby faster than their generic counterparts.
self + other:T self - other:T self * other:T self // other:T self ** other:TAll operations except for normal division are supported.self:IntAny IntXXX or UIntXXX may be implicitly cast to Intself:UIntAny UIntXXX may be implicitly cast to UIntself as IntXXX self as UIntXXXAny T may be explicitly cast to any other sized integer type.self as Byte[]Any IntXXX or UIntXXX may be cast to it’s underlying representation.
class Float32
class Float64
class UFloat32
class UFloat64
Each FloatXX and UFloatXX class is a direct mapping to floating point numbers (signed or unsigned) of XX number of bits. Operations with these types are typically single instructions and thereby a lot faster than their generic counterparts.
self + other:T self - other:T self * other:T self / other:T self ** other:TAll operations except for integer division are supported.self:RealAny FloatXX or UFloatXX may be implicitly cast to Real.self:URealAny UFloatXX may be implicitly cast to URealself as FloatXX self as UFloatXXAny T may be explicitly cast to any other sized integer type.self as Byte[]Any FloatXX or UFloatXX may be cast to it’s underlying representation.