ULong
inline class ULong : Comparable<ULong>
Functions
and
Performs a bitwise AND operation between the two values.
infix fun and(other: ULong): ULong
compareTo
Compares this value with the specified value for order. Returns zero if this value is equal to the specified other value, a negative number if it's less than other, or a positive number if it's greater than other.
operator fun compareTo(other: UByte): Int
operator fun compareTo(other: UShort): Int
operator fun compareTo(other: UInt): Int
operator fun compareTo(other: ULong): Int
dec
Returns this value decremented by one.
operator fun dec(): ULong
div
Divides this value by the other value, truncating the result to an integer that is closer to zero.
operator fun div(other: UByte): ULong
operator fun div(other: UShort): ULong
operator fun div(other: UInt): ULong
operator fun div(other: ULong): ULong
floorDiv
Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.
fun floorDiv(other: UByte): ULong
fun floorDiv(other: UShort): ULong
fun floorDiv(other: UInt): ULong
fun floorDiv(other: ULong): ULong
inc
Returns this value incremented by one.
operator fun inc(): ULong
inv
Inverts the bits in this value.
fun inv(): ULong
minus
Subtracts the other value from this value.
operator fun minus(other: UByte): ULong
operator fun minus(other: UShort): ULong
operator fun minus(other: UInt): ULong
operator fun minus(other: ULong): ULong
mod
Calculates the remainder of flooring division of this value by the other value.
fun mod(other: UByte): UByte
fun mod(other: UShort): UShort
fun mod(other: UInt): UInt
fun mod(other: ULong): ULong
or
Performs a bitwise OR operation between the two values.
infix fun or(other: ULong): ULong
plus
Adds the other value to this value.
operator fun plus(other: UByte): ULong
operator fun plus(other: UShort): ULong
operator fun plus(other: UInt): ULong
operator fun plus(other: ULong): ULong
rangeTo
Creates a range from this value to the specified other value.
operator fun rangeTo(other: ULong): ULongRange
rem
Calculates the remainder of truncating division of this value by the other value.
operator fun rem(other: UByte): ULong
operator fun rem(other: UShort): ULong
operator fun rem(other: UInt): ULong
operator fun rem(other: ULong): ULong
shl
Shifts this value left by the bitCount number of bits.
infix fun shl(bitCount: Int): ULong
shr
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
infix fun shr(bitCount: Int): ULong
times
Multiplies this value by the other value.
operator fun times(other: UByte): ULong
operator fun times(other: UShort): ULong
operator fun times(other: UInt): ULong
operator fun times(other: ULong): ULong
toByte
toDouble
toFloat
toInt
toLong
toShort
toString
Returns a string representation of the object.
fun toString(): String
toUByte
toUInt
toULong
Returns this value.
fun toULong(): ULong
toUShort
xor
Performs a bitwise XOR operation between the two values.
infix fun xor(other: ULong): ULong
Companion Object Properties
MAX_VALUE
A constant holding the maximum value an instance of ULong can have.
const val MAX_VALUE: ULong
MIN_VALUE
A constant holding the minimum value an instance of ULong can have.
const val MIN_VALUE: ULong
SIZE_BITS
The number of bits used to represent an instance of ULong in a binary form.
const val SIZE_BITS: Int
SIZE_BYTES
The number of bytes used to represent an instance of ULong in a binary form.
const val SIZE_BYTES: Int
Extension Functions
coerceAtLeast
Ensures that this value is not less than the specified minimumValue.
fun ULong.coerceAtLeast(minimumValue: ULong): ULong
fun <T : Comparable<T>> T.coerceAtLeast(minimumValue: T): T
coerceAtMost
Ensures that this value is not greater than the specified maximumValue.
fun ULong.coerceAtMost(maximumValue: ULong): ULong
fun <T : Comparable<T>> T.coerceAtMost(maximumValue: T): T
coerceIn
Ensures that this value lies in the specified range minimumValue..maximumValue.
fun ULong.coerceIn( minimumValue: ULong, maximumValue: ULong ): ULong
fun <T : Comparable<T>> T.coerceIn( minimumValue: T?, maximumValue: T? ): T
Ensures that this value lies in the specified range.
fun ULong.coerceIn(range: ClosedRange<ULong>): ULong
fun <T : Comparable<T>> T.coerceIn( range: ClosedFloatingPointRange<T> ): T
fun <T : Comparable<T>> T.coerceIn(range: ClosedRange<T>): T
compareTo
convert
fun <R : Any> ULong.convert(): R
countLeadingZeroBits
Counts the number of consecutive most significant bits that are zero in the binary representation of this ULong number.
fun ULong.countLeadingZeroBits(): Int
countOneBits
Counts the number of set bits in the binary representation of this ULong number.
fun ULong.countOneBits(): Int
countTrailingZeroBits
Counts the number of consecutive least significant bits that are zero in the binary representation of this ULong number.
fun ULong.countTrailingZeroBits(): Int
downTo
Returns a progression from this value down to the specified to value with the step -1.
infix fun ULong.downTo(to: ULong): ULongProgression
rangeTo
Creates a range from this Comparable value to the specified that value.
operator fun <T : Comparable<T>> T.rangeTo( that: T ): ClosedRange<T>
rotateLeft
rotateRight
takeHighestOneBit
Returns a number having a single bit set in the position of the most significant set bit of this ULong number, or zero, if this number is zero.
fun ULong.takeHighestOneBit(): ULong
takeLowestOneBit
Returns a number having a single bit set in the position of the least significant set bit of this ULong number, or zero, if this number is zero.
fun ULong.takeLowestOneBit(): ULong
toString
© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html