struct ULong
source · line 7public struct ULong : Add<ULong, ULong>, Sub<ULong, ULong>, Mul<ULong, ULong>, Div<ULong, ULong>, Rem<ULong, ULong>, UnaryPlus<ULong>, UnaryMinus<ULong>, Increment<ULong>, Decrement<ULong>, Compare<ULong>, RangeTo<ULong, ULongRange>, RangeUntil<ULong, ULongRange>, Equals<ULong>, ToString, Hash
- Supertype
Add<ULong, ULong> - Supertype
Sub<ULong, ULong> - Supertype
Mul<ULong, ULong> - Supertype
Div<ULong, ULong> - Supertype
Rem<ULong, ULong> - Supertype
UnaryPlus<ULong> - Supertype
UnaryMinus<ULong> - Supertype
Increment<ULong> - Supertype
Decrement<ULong> - Supertype
Compare<ULong> - Supertype
RangeTo<ULong, ULongRange> - Supertype
RangeUntil<ULong, ULongRange> - Supertype
Equals<ULong> - Supertype
ToString - Supertype
Hash
A 64-bit unsigned integer. Arithmetic wraps modulo 2^64; division by zero throws ArithmeticException. Conversions are explicit and preserve the language's fixed-width rules on every target.
Extensions
public fun ULong.toBigDecimal(): BigDecimal· scoop:scoop.math:0.1.0public fun ULong.toBigInteger(): BigInteger· scoop:scoop.math:0.1.0public fun ULong.toString(radix: Int): String· scoop:scoop.std:0.1.0
function toUShort
source · line 196@NoGC
@Intrinsic("ulong_to_uint16")
public fun toUShort(): UShort
Converts modulo 2^16 and interprets the result as a 16-bit unsigned integer. The conversion always succeeds.
function div
source · line 93@Intrinsic("ulong_div")
public override operator fun div(other: ULong): ULong
- Overrides
div· Div
Returns the quotient truncated toward zero. A zero divisor throws ArithmeticException.
parameter other
source · line 94other: ULong
function toLong
source · line 180@NoGC
@Intrinsic("ulong_to_long")
public fun toLong(): Long
Converts modulo 2^64 and interprets the result as a 64-bit signed integer. The conversion always succeeds.
function downTo
source · line 237public infix fun downTo(endpoint: ULong): ULongRange
Creates a descending range including both endpoints.
parameter endpoint
source · line 237endpoint: ULong
function toShort
source · line 164@NoGC
@Intrinsic("ulong_to_int16")
public fun toShort(): Short
Converts modulo 2^16 and interprets the result as a 16-bit signed integer. The conversion always succeeds.
function unaryMinus
source · line 51@NoGC
@Intrinsic("ulong_unary_minus")
public override operator fun unaryMinus(): ULong
- Overrides
unaryMinus· UnaryMinus
Returns the additive inverse modulo 2^64, including at the representation boundary.
function dec
source · line 65@NoGC
@Intrinsic("ulong_dec")
public override operator fun dec(): ULong
- Overrides
dec· Decrement
Returns the value minus one, wrapping modulo 2^64.
function inv
source · line 134@NoGC
@Intrinsic("ulong_inv")
public fun inv(): ULong
Flips all 64 bits of the representation.
function hash
source · line 248public override fun hash(): Long
- Overrides
hash· Hash
Returns a hash consistent with same-type integer equality.
function shr
source · line 148@NoGC
@Intrinsic("ulong_shr")
public infix fun shr(count: Long): ULong
Shifts right using the low 6 bits of the Long count, filling with zero bits.
parameter count
source · line 150count: Long
function until
source · line 231public infix fun until(endpoint: ULong): ULongRange
Creates an ascending range with an exclusive endpoint.
parameter endpoint
source · line 231endpoint: ULong
function rem
source · line 100@Intrinsic("ulong_rem")
public override operator fun rem(other: ULong): ULong
- Overrides
rem· Rem
Returns the remainder associated with division truncated toward zero. A zero divisor throws ArithmeticException.
parameter other
source · line 101other: ULong
function toByte
source · line 156@NoGC
@Intrinsic("ulong_to_int8")
public fun toByte(): Byte
Converts modulo 2^8 and interprets the result as a 8-bit signed integer. The conversion always succeeds.
function rangeTo
source · line 219public override operator fun rangeTo(endpoint: ULong): ULongRange
- Overrides
rangeTo· RangeTo
Creates an ascending range including both this value and the endpoint.
parameter endpoint
source · line 219endpoint: ULong
function toDouble
source · line 30@NoGC @Intrinsic("ulong_to_double")
public fun toDouble(): Double
Rounds the integer directly to IEEE binary64 using round-to-nearest, ties-to-even.
function shl
source · line 141@NoGC
@Intrinsic("ulong_shl")
public infix fun shl(count: Long): ULong
Shifts left using the low 6 bits of the Long count; shifted-out bits are discarded.
parameter count
source · line 143count: Long
function rangeUntil
source · line 225public override operator fun rangeUntil(endpoint: ULong): ULongRange
- Overrides
rangeUntil· RangeUntil
Creates an ascending range including this value and excluding the endpoint.
parameter endpoint
source · line 225endpoint: ULong
function toInt
source · line 172@NoGC
@Intrinsic("ulong_to_int")
public fun toInt(): Int
Converts modulo 2^32 and interprets the result as a 32-bit signed integer. The conversion always succeeds.
function or
source · line 120@NoGC
@Intrinsic("ulong_or")
public infix fun or(other: ULong): ULong
Returns the bitwise union of the 64-bit operands.
parameter other
source · line 122other: ULong
function equals
source · line 36@NoGC
@Intrinsic("ulong_equals")
public override operator fun equals(other: ULong): Boolean
- Overrides
equals· Equals
Compares the mathematical values of two integers of the same type.
parameter other
source · line 38other: ULong
function times
source · line 86@NoGC
@Intrinsic("ulong_mul")
public override operator fun times(other: ULong): ULong
- Overrides
times· Mul
Returns the product modulo 2^64; overflow does not throw.
parameter other
source · line 88other: ULong
function toUByte
source · line 188@NoGC
@Intrinsic("ulong_to_uint8")
public fun toUByte(): UByte
Converts modulo 2^8 and interprets the result as a 8-bit unsigned integer. The conversion always succeeds.
function and
source · line 113@NoGC
@Intrinsic("ulong_and")
public infix fun and(other: ULong): ULong
Returns the bitwise intersection of the 64-bit operands.
parameter other
source · line 115other: ULong
function unaryPlus
source · line 44@NoGC
@Intrinsic("ulong_unary_plus")
public override operator fun unaryPlus(): ULong
- Overrides
unaryPlus· UnaryPlus
Returns the unchanged integer value.
function plus
source · line 72@NoGC
@Intrinsic("ulong_add")
public override operator fun plus(other: ULong): ULong
- Overrides
plus· Add
Returns the sum modulo 2^64; overflow does not throw.
parameter other
source · line 74other: ULong
function minus
source · line 79@NoGC
@Intrinsic("ulong_sub")
public override operator fun minus(other: ULong): ULong
- Overrides
minus· Sub
Returns the difference modulo 2^64; overflow does not throw.
parameter other
source · line 81other: ULong
function inc
source · line 58@NoGC
@Intrinsic("ulong_inc")
public override operator fun inc(): ULong
- Overrides
inc· Increment
Returns the value plus one, wrapping modulo 2^64.
function xor
source · line 127@NoGC
@Intrinsic("ulong_xor")
public infix fun xor(other: ULong): ULong
Sets each result bit where the corresponding 64-bit operand bits differ.
parameter other
source · line 129other: ULong
function toString
source · line 243public override fun toString(): String
- Overrides
toString· ToString
Returns the locale-independent decimal representation of this integer.
function toFloat
source · line 24@NoGC @Intrinsic("ulong_to_float")
public fun toFloat(): Float
Rounds the integer directly to IEEE binary32 using round-to-nearest, ties-to-even.
function compareTo
source · line 106@NoGC
@Intrinsic("ulong_compare_to")
public override operator fun compareTo(other: ULong): Long
- Overrides
compareTo· Compare
Returns -1, 0, or 1 using unsigned mathematical ordering.
parameter other
source · line 108other: ULong
function toULong
source · line 212@NoGC
@Intrinsic("ulong_to_ulong")
public fun toULong(): ULong
Converts modulo 2^64 and interprets the result as a 64-bit unsigned integer. The conversion always succeeds.
function toUInt
source · line 204@NoGC
@Intrinsic("ulong_to_uint")
public fun toUInt(): UInt
Converts modulo 2^32 and interprets the result as a 32-bit unsigned integer. The conversion always succeeds.