struct UInt128
inherits Int
¶
Constants¶
MAX = ~MIN
¶
~MIN
MIN = new(0)
¶
new(0)
Todo
eventually update to literals once UInt128 bit support is finished
Class methods¶
Methods¶
#&(other : Int16) : self
¶
(other : Int16) : self
Returns the result of performing a bitwise AND of self
's and other's bits.
#&(other : Int32) : self
¶
(other : Int32) : self
Returns the result of performing a bitwise AND of self
's and other's bits.
#&(other : Int64) : self
¶
(other : Int64) : self
Returns the result of performing a bitwise AND of self
's and other's bits.
#&(other : UInt128) : self
¶
(other : UInt128) : self
Returns the result of performing a bitwise AND of self
's and other's bits.
#&(other : UInt64) : self
¶
(other : UInt64) : self
Returns the result of performing a bitwise AND of self
's and other's bits.
#&(other : UInt32) : self
¶
(other : UInt32) : self
Returns the result of performing a bitwise AND of self
's and other's bits.
#&(other : UInt16) : self
¶
(other : UInt16) : self
Returns the result of performing a bitwise AND of self
's and other's bits.
#&(other : Int128) : self
¶
(other : Int128) : self
Returns the result of performing a bitwise AND of self
's and other's bits.
#&(other : Int8) : self
¶
(other : Int8) : self
Returns the result of performing a bitwise AND of self
's and other's bits.
#&(other : UInt8) : self
¶
(other : UInt8) : self
Returns the result of performing a bitwise AND of self
's and other's bits.
#&*(other : UInt128) : self
¶
(other : UInt128) : self
Returns the result of multiplying self
and other.
In case of overflow a wrapping is performed.
#&*(other : UInt64) : self
¶
(other : UInt64) : self
Returns the result of multiplying self
and other.
In case of overflow a wrapping is performed.
#&*(other : UInt32) : self
¶
(other : UInt32) : self
Returns the result of multiplying self
and other.
In case of overflow a wrapping is performed.
#&*(other : UInt16) : self
¶
(other : UInt16) : self
Returns the result of multiplying self
and other.
In case of overflow a wrapping is performed.
#&*(other : UInt8) : self
¶
(other : UInt8) : self
Returns the result of multiplying self
and other.
In case of overflow a wrapping is performed.
#&*(other : Int32) : self
¶
(other : Int32) : self
Returns the result of multiplying self
and other.
In case of overflow a wrapping is performed.
#&*(other : Int64) : self
¶
(other : Int64) : self
Returns the result of multiplying self
and other.
In case of overflow a wrapping is performed.
#&*(other : Int16) : self
¶
(other : Int16) : self
Returns the result of multiplying self
and other.
In case of overflow a wrapping is performed.
#&*(other : Int8) : self
¶
(other : Int8) : self
Returns the result of multiplying self
and other.
In case of overflow a wrapping is performed.
#&*(other : Int128) : self
¶
(other : Int128) : self
Returns the result of multiplying self
and other.
In case of overflow a wrapping is performed.
#&+(other : UInt16) : self
¶
(other : UInt16) : self
Returns the result of adding self
and other.
In case of overflow a wrapping is performed.
#&+(other : UInt8) : self
¶
(other : UInt8) : self
Returns the result of adding self
and other.
In case of overflow a wrapping is performed.
#&+(other : Int128) : self
¶
(other : Int128) : self
Returns the result of adding self
and other.
In case of overflow a wrapping is performed.
#&+(other : UInt32) : self
¶
(other : UInt32) : self
Returns the result of adding self
and other.
In case of overflow a wrapping is performed.
#&+(other : UInt64) : self
¶
(other : UInt64) : self
Returns the result of adding self
and other.
In case of overflow a wrapping is performed.
#&+(other : UInt128) : self
¶
(other : UInt128) : self
Returns the result of adding self
and other.
In case of overflow a wrapping is performed.
#&+(other : Int8) : self
¶
(other : Int8) : self
Returns the result of adding self
and other.
In case of overflow a wrapping is performed.
#&+(other : Int16) : self
¶
(other : Int16) : self
Returns the result of adding self
and other.
In case of overflow a wrapping is performed.
#&+(other : Int32) : self
¶
(other : Int32) : self
Returns the result of adding self
and other.
In case of overflow a wrapping is performed.
#&+(other : Int64) : self
¶
(other : Int64) : self
Returns the result of adding self
and other.
In case of overflow a wrapping is performed.
#&-(other : Int8) : self
¶
(other : Int8) : self
Returns the result of subtracting self
and other.
In case of overflow a wrapping is performed.
#&-(other : Int16) : self
¶
(other : Int16) : self
Returns the result of subtracting self
and other.
In case of overflow a wrapping is performed.
#&-(other : Int32) : self
¶
(other : Int32) : self
Returns the result of subtracting self
and other.
In case of overflow a wrapping is performed.
#&-(other : Int64) : self
¶
(other : Int64) : self
Returns the result of subtracting self
and other.
In case of overflow a wrapping is performed.
#&-(other : UInt128) : self
¶
(other : UInt128) : self
Returns the result of subtracting self
and other.
In case of overflow a wrapping is performed.
#&-(other : Int128) : self
¶
(other : Int128) : self
Returns the result of subtracting self
and other.
In case of overflow a wrapping is performed.
#&-(other : UInt64) : self
¶
(other : UInt64) : self
Returns the result of subtracting self
and other.
In case of overflow a wrapping is performed.
#&-(other : UInt32) : self
¶
(other : UInt32) : self
Returns the result of subtracting self
and other.
In case of overflow a wrapping is performed.
#&-(other : UInt16) : self
¶
(other : UInt16) : self
Returns the result of subtracting self
and other.
In case of overflow a wrapping is performed.
#&-(other : UInt8) : self
¶
(other : UInt8) : self
Returns the result of subtracting self
and other.
In case of overflow a wrapping is performed.
#*(other : Int8) : self
¶
(other : Int8) : self
Returns the result of multiplying self
and other.
Raises OverflowError
in case of overflow.
#*(other : Int16) : self
¶
(other : Int16) : self
Returns the result of multiplying self
and other.
Raises OverflowError
in case of overflow.
#*(other : Int32) : self
¶
(other : Int32) : self
Returns the result of multiplying self
and other.
Raises OverflowError
in case of overflow.
#*(other : Int64) : self
¶
(other : Int64) : self
Returns the result of multiplying self
and other.
Raises OverflowError
in case of overflow.
#*(other : Int128) : self
¶
(other : Int128) : self
Returns the result of multiplying self
and other.
Raises OverflowError
in case of overflow.
#*(other : UInt8) : self
¶
(other : UInt8) : self
Returns the result of multiplying self
and other.
Raises OverflowError
in case of overflow.
#*(other : UInt16) : self
¶
(other : UInt16) : self
Returns the result of multiplying self
and other.
Raises OverflowError
in case of overflow.
#*(other : UInt32) : self
¶
(other : UInt32) : self
Returns the result of multiplying self
and other.
Raises OverflowError
in case of overflow.
#*(other : UInt64) : self
¶
(other : UInt64) : self
Returns the result of multiplying self
and other.
Raises OverflowError
in case of overflow.
#*(other : UInt128) : self
¶
(other : UInt128) : self
Returns the result of multiplying self
and other.
Raises OverflowError
in case of overflow.
#+(other : UInt128) : self
¶
(other : UInt128) : self
Returns the result of adding self
and other.
Raises OverflowError
in case of overflow.
#+(other : Int128) : self
¶
(other : Int128) : self
Returns the result of adding self
and other.
Raises OverflowError
in case of overflow.
#+(other : Int64) : self
¶
(other : Int64) : self
Returns the result of adding self
and other.
Raises OverflowError
in case of overflow.
#+(other : Int32) : self
¶
(other : Int32) : self
Returns the result of adding self
and other.
Raises OverflowError
in case of overflow.
#+(other : Int16) : self
¶
(other : Int16) : self
Returns the result of adding self
and other.
Raises OverflowError
in case of overflow.
#+(other : Int8) : self
¶
(other : Int8) : self
Returns the result of adding self
and other.
Raises OverflowError
in case of overflow.
#+(other : UInt16) : self
¶
(other : UInt16) : self
Returns the result of adding self
and other.
Raises OverflowError
in case of overflow.
#+(other : UInt8) : self
¶
(other : UInt8) : self
Returns the result of adding self
and other.
Raises OverflowError
in case of overflow.
#+(other : UInt32) : self
¶
(other : UInt32) : self
Returns the result of adding self
and other.
Raises OverflowError
in case of overflow.
#+(other : UInt64) : self
¶
(other : UInt64) : self
Returns the result of adding self
and other.
Raises OverflowError
in case of overflow.
#-(other : UInt32) : self
¶
(other : UInt32) : self
Returns the result of subtracting self
and other.
Raises OverflowError
in case of overflow.
#-(other : UInt16) : self
¶
(other : UInt16) : self
Returns the result of subtracting self
and other.
Raises OverflowError
in case of overflow.
#-(other : UInt128) : self
¶
(other : UInt128) : self
Returns the result of subtracting self
and other.
Raises OverflowError
in case of overflow.
#-(other : UInt8) : self
¶
(other : UInt8) : self
Returns the result of subtracting self
and other.
Raises OverflowError
in case of overflow.
#-(other : Int128) : self
¶
(other : Int128) : self
Returns the result of subtracting self
and other.
Raises OverflowError
in case of overflow.
#-(other : Int64) : self
¶
(other : Int64) : self
Returns the result of subtracting self
and other.
Raises OverflowError
in case of overflow.
#-(other : Int32) : self
¶
(other : Int32) : self
Returns the result of subtracting self
and other.
Raises OverflowError
in case of overflow.
#-(other : Int16) : self
¶
(other : Int16) : self
Returns the result of subtracting self
and other.
Raises OverflowError
in case of overflow.
#-(other : Int8) : self
¶
(other : Int8) : self
Returns the result of subtracting self
and other.
Raises OverflowError
in case of overflow.
#-(other : UInt64) : self
¶
(other : UInt64) : self
Returns the result of subtracting self
and other.
Raises OverflowError
in case of overflow.
#^(other : Int8) : self
¶
(other : Int8) : self
Returns the result of performing a bitwise XOR of self
's and other's bits.
#^(other : Int16) : self
¶
(other : Int16) : self
Returns the result of performing a bitwise XOR of self
's and other's bits.
#^(other : Int32) : self
¶
(other : Int32) : self
Returns the result of performing a bitwise XOR of self
's and other's bits.
#^(other : Int64) : self
¶
(other : Int64) : self
Returns the result of performing a bitwise XOR of self
's and other's bits.
#^(other : Int128) : self
¶
(other : Int128) : self
Returns the result of performing a bitwise XOR of self
's and other's bits.
#^(other : UInt8) : self
¶
(other : UInt8) : self
Returns the result of performing a bitwise XOR of self
's and other's bits.
#^(other : UInt16) : self
¶
(other : UInt16) : self
Returns the result of performing a bitwise XOR of self
's and other's bits.
#^(other : UInt32) : self
¶
(other : UInt32) : self
Returns the result of performing a bitwise XOR of self
's and other's bits.
#^(other : UInt64) : self
¶
(other : UInt64) : self
Returns the result of performing a bitwise XOR of self
's and other's bits.
#^(other : UInt128) : self
¶
(other : UInt128) : self
Returns the result of performing a bitwise XOR of self
's and other's bits.
#popcount
¶
Counts 1
-bits in the binary representation of this integer.
5.popcount # => 2
-15.popcount # => 29
#to_f : Float64
¶
: Float64
Returns self
converted to Float64
.
Raises OverflowError
in case of overflow.
#to_f! : Float64
¶
: Float64
Returns self
converted to Float64
.
In case of overflow a wrapping is performed.
#to_f32 : Float32
¶
: Float32
Returns self
converted to Float32
.
Raises OverflowError
in case of overflow.
#to_f32! : Float32
¶
: Float32
Returns self
converted to Float32
.
In case of overflow a wrapping is performed.
#to_f64 : Float64
¶
: Float64
Returns self
converted to Float64
.
Raises OverflowError
in case of overflow.
#to_f64! : Float64
¶
: Float64
Returns self
converted to Float64
.
In case of overflow a wrapping is performed.
#to_i : Int32
¶
: Int32
Returns self
converted to Int32
.
Raises OverflowError
in case of overflow.
#to_i! : Int32
¶
: Int32
Returns self
converted to Int32
.
In case of overflow a wrapping is performed.
#to_i128 : Int128
¶
: Int128
Returns self
converted to Int128
.
Raises OverflowError
in case of overflow.
#to_i128! : Int128
¶
: Int128
Returns self
converted to Int128
.
In case of overflow a wrapping is performed.
#to_i16 : Int16
¶
: Int16
Returns self
converted to Int16
.
Raises OverflowError
in case of overflow.
#to_i16! : Int16
¶
: Int16
Returns self
converted to Int16
.
In case of overflow a wrapping is performed.
#to_i32 : Int32
¶
: Int32
Returns self
converted to Int32
.
Raises OverflowError
in case of overflow.
#to_i32! : Int32
¶
: Int32
Returns self
converted to Int32
.
In case of overflow a wrapping is performed.
#to_i64 : Int64
¶
: Int64
Returns self
converted to Int64
.
Raises OverflowError
in case of overflow.
#to_i64! : Int64
¶
: Int64
Returns self
converted to Int64
.
In case of overflow a wrapping is performed.
#to_i8 : Int8
¶
: Int8
Returns self
converted to Int8
.
Raises OverflowError
in case of overflow.
#to_i8! : Int8
¶
: Int8
Returns self
converted to Int8
.
In case of overflow a wrapping is performed.
#to_u : UInt32
¶
: UInt32
Returns self
converted to UInt32
.
Raises OverflowError
in case of overflow.
#to_u! : UInt32
¶
: UInt32
Returns self
converted to UInt32
.
In case of overflow a wrapping is performed.
#to_u128 : UInt128
¶
: UInt128
Returns self
converted to UInt128
.
Raises OverflowError
in case of overflow.
#to_u128! : UInt128
¶
: UInt128
Returns self
converted to UInt128
.
In case of overflow a wrapping is performed.
#to_u16 : UInt16
¶
: UInt16
Returns self
converted to UInt16
.
Raises OverflowError
in case of overflow.
#to_u16! : UInt16
¶
: UInt16
Returns self
converted to UInt16
.
In case of overflow a wrapping is performed.
#to_u32 : UInt32
¶
: UInt32
Returns self
converted to UInt32
.
Raises OverflowError
in case of overflow.
#to_u32! : UInt32
¶
: UInt32
Returns self
converted to UInt32
.
In case of overflow a wrapping is performed.
#to_u64 : UInt64
¶
: UInt64
Returns self
converted to UInt64
.
Raises OverflowError
in case of overflow.
#to_u64! : UInt64
¶
: UInt64
Returns self
converted to UInt64
.
In case of overflow a wrapping is performed.
#to_u8 : UInt8
¶
: UInt8
Returns self
converted to UInt8
.
Raises OverflowError
in case of overflow.
#to_u8! : UInt8
¶
: UInt8
Returns self
converted to UInt8
.
In case of overflow a wrapping is performed.
#unsafe_chr : Char
¶
: Char
Returns a Char
that has the unicode codepoint of self
,
without checking if this integer is in the range valid for
chars (0..0x10ffff
).
You should never use this method unless chr
turns out to
be a bottleneck.
97.unsafe_chr # => 'a'
#|(other : Int8) : self
¶
(other : Int8) : self
Returns the result of performing a bitwise OR of self
's and other's bits.
#|(other : Int16) : self
¶
(other : Int16) : self
Returns the result of performing a bitwise OR of self
's and other's bits.
#|(other : UInt128) : self
¶
(other : UInt128) : self
Returns the result of performing a bitwise OR of self
's and other's bits.
#|(other : UInt64) : self
¶
(other : UInt64) : self
Returns the result of performing a bitwise OR of self
's and other's bits.
#|(other : UInt32) : self
¶
(other : UInt32) : self
Returns the result of performing a bitwise OR of self
's and other's bits.
#|(other : UInt16) : self
¶
(other : UInt16) : self
Returns the result of performing a bitwise OR of self
's and other's bits.
#|(other : UInt8) : self
¶
(other : UInt8) : self
Returns the result of performing a bitwise OR of self
's and other's bits.
#|(other : Int128) : self
¶
(other : Int128) : self
Returns the result of performing a bitwise OR of self
's and other's bits.
#|(other : Int64) : self
¶
(other : Int64) : self
Returns the result of performing a bitwise OR of self
's and other's bits.
#|(other : Int32) : self
¶
(other : Int32) : self
Returns the result of performing a bitwise OR of self
's and other's bits.