ULong

Common
JVM
JS
Native
1.3
@ExperimentalUnsignedTypes inline class ULong : 
    Comparable<ULong>

Functions

Common
JVM
JS
Native
1.0

and

Performs a bitwise AND operation between the two values.

infix fun and(other: ULong): ULong
Common
JVM
JS
Native
1.0

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
Common
JVM
JS
Native
1.0

dec

Decrements this value.

operator fun dec(): ULong
Common
JVM
JS
Native
1.0

div

Divides this value by the other value.

operator fun div(other: UByte): ULong
operator fun div(other: UShort): ULong
operator fun div(other: UInt): ULong
operator fun div(other: ULong): ULong
Common
JVM
JS
Native
1.0

inc

Increments this value.

operator fun inc(): ULong
Common
JVM
JS
Native
1.0

inv

Inverts the bits in this value.

fun inv(): ULong
Common
JVM
JS
Native
1.0

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
Common
JVM
JS
Native
1.0

or

Performs a bitwise OR operation between the two values.

infix fun or(other: ULong): ULong
Common
JVM
JS
Native
1.0

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
Common
JVM
JS
Native
1.0

rangeTo

Creates a range from this value to the specified other value.

operator fun rangeTo(other: ULong): ULongRange
Common
JVM
JS
Native
1.0

rem

Calculates the remainder of dividing 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
Common
JVM
JS
Native
1.0

shl

Shifts this value left by the bitCount number of bits.

infix fun shl(bitCount: Int): ULong
Common
JVM
JS
Native
1.0

shr

Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.

infix fun shr(bitCount: Int): ULong
Common
JVM
JS
Native
1.0

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
Common
JVM
JS
Native
1.0

toByte

Converts this ULong value to Byte.

fun toByte(): Byte
Common
JVM
JS
Native
1.0

toDouble

Converts this ULong value to Double.

fun toDouble(): Double
Common
JVM
JS
Native
1.0

toFloat

Converts this ULong value to Float.

fun toFloat(): Float
Common
JVM
JS
Native
1.0

toInt

Converts this ULong value to Int.

fun toInt(): Int
Common
JVM
JS
Native
1.0

toLong

Converts this ULong value to Long.

fun toLong(): Long
Common
JVM
JS
Native
1.0

toShort

Converts this ULong value to Short.

fun toShort(): Short
Common
JVM
JS
Native
1.0

toString

Returns a string representation of the object.

fun toString(): String
Common
JVM
JS
Native
1.0

toUByte

Converts this ULong value to UByte.

fun toUByte(): UByte
Common
JVM
JS
Native
1.0

toUInt

Converts this ULong value to UInt.

fun toUInt(): UInt
Common
JVM
JS
Native
1.0

toULong

Returns this value.

fun toULong(): ULong
Common
JVM
JS
Native
1.0

toUShort

Converts this ULong value to UShort.

fun toUShort(): UShort
Common
JVM
JS
Native
1.0

xor

Performs a bitwise XOR operation between the two values.

infix fun xor(other: ULong): ULong

Companion Object Properties

Common
JVM
JS
Native
1.0

MAX_VALUE

A constant holding the maximum value an instance of ULong can have.

const val MAX_VALUE: ULong
Common
JVM
JS
Native
1.0

MIN_VALUE

A constant holding the minimum value an instance of ULong can have.

const val MIN_VALUE: ULong
Common
JVM
JS
Native
1.0

SIZE_BITS

The number of bits used to represent an instance of ULong in a binary form.

const val SIZE_BITS: Int
Common
JVM
JS
Native
1.0

SIZE_BYTES

The number of bytes used to represent an instance of ULong in a binary form.

const val SIZE_BYTES: Int

Extension Functions

Common
JVM
JS
Native
1.0

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
Common
JVM
JS
Native
1.0

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
Common
JVM
JS
Native
1.0

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
Native
1.3

convert

fun <R : Any> ULong.convert(): R
Common
JVM
JS
Native
1.3

countLeadingZeroBits

Counts the number of consecutive most significant bits that are zero in the binary representation of this ULong number.

fun ULong.countLeadingZeroBits(): Int
Common
JVM
JS
Native
1.3

countOneBits

Counts the number of set bits in the binary representation of this ULong number.

fun ULong.countOneBits(): Int
Common
JVM
JS
Native
1.3

countTrailingZeroBits

Counts the number of consecutive least significant bits that are zero in the binary representation of this ULong number.

fun ULong.countTrailingZeroBits(): Int
Common
JVM
JS
Native
1.3

downTo

Returns a progression from this value down to the specified to value with the step -1.

infix fun ULong.downTo(to: ULong): ULongProgression
Common
JVM
JS
Native
1.0

rangeTo

Creates a range from this Comparable value to the specified that value.

operator fun <T : Comparable<T>> T.rangeTo(
    that: T
): ClosedRange<T>
Common
JVM
JS
Native
1.3

rotateLeft

Rotates the binary representation of this ULong number left by the specified bitCount number of bits. The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.

fun ULong.rotateLeft(bitCount: Int): ULong
Common
JVM
JS
Native
1.3

rotateRight

Rotates the binary representation of this ULong number right by the specified bitCount number of bits. The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.

fun ULong.rotateRight(bitCount: Int): ULong
Common
JVM
JS
Native
1.3

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
Common
JVM
JS
Native
1.3

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
Common
JVM
JS
Native
1.3

toString

Returns a string representation of this Long value in the specified radix.

fun ULong.toString(radix: Int): String
Common
JVM
JS
Native
1.3

until

Returns a range from this value up to but excluding the specified to value.

infix fun ULong.until(to: ULong): ULongRange