UInt128

class UInt128(val upper: ULong, val lower: ULong) : Comparable<UInt128> (source)

Represents a 128-bit unsigned integer.

Constructors

Link copied to clipboard
constructor(upper: ULong, lower: ULong)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The least significant word.

Link copied to clipboard

The most significant word.

Functions

Link copied to clipboard
infix fun and(other: UInt128): UInt128

Performs a bitwise AND operation between the two values.

Link copied to clipboard
open operator override fun compareTo(other: UInt128): Int
inline operator fun compareTo(other: UByte): Int
inline operator fun compareTo(other: UInt): Int
inline operator fun compareTo(other: ULong): Int
inline operator fun compareTo(other: UShort): Int

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.

Link copied to clipboard

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

Link copied to clipboard
inline fun UInt128.countOneBits(): Int

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

Link copied to clipboard

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

Link copied to clipboard
operator fun dec(): UInt128

Returns this value decremented by one.

Link copied to clipboard
operator fun div(other: UInt128): UInt128
inline operator fun div(other: UByte): UInt128
inline operator fun div(other: UInt): UInt128
inline operator fun div(other: ULong): UInt128
inline operator fun div(other: UShort): UInt128

Divides this value by the other value, truncating the result to an integer that is closer to zero.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
inline fun floorDiv(other: UInt128): UInt128
inline fun floorDiv(other: UByte): UInt128
inline fun floorDiv(other: UInt): UInt128
inline fun floorDiv(other: ULong): UInt128
inline fun floorDiv(other: UShort): UInt128

Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
operator fun inc(): UInt128

Returns this value incremented by one.

Link copied to clipboard
fun inv(): UInt128

Inverts the bits in this value.

Link copied to clipboard

Get the floor value of the exact square root of this

Link copied to clipboard
operator fun minus(other: UInt128): UInt128
inline operator fun minus(other: UByte): UInt128
inline operator fun minus(other: UInt): UInt128
inline operator fun minus(other: ULong): UInt128
inline operator fun minus(other: UShort): UInt128

Subtracts the other value from this value.

Link copied to clipboard
inline fun mod(other: UInt128): UInt128
inline fun mod(other: UByte): UByte
inline fun mod(other: UInt): UInt
inline fun mod(other: ULong): ULong
inline fun mod(other: UShort): UShort

Calculates the remainder of flooring division of this value by the other value.

Link copied to clipboard
infix fun or(other: UInt128): UInt128

Performs a bitwise OR operation between the two values.

Link copied to clipboard
operator fun plus(other: UInt128): UInt128
inline operator fun plus(other: UByte): UInt128
inline operator fun plus(other: UInt): UInt128
inline operator fun plus(other: ULong): UInt128
inline operator fun plus(other: UShort): UInt128

Adds the other value to this value.

Link copied to clipboard

Raises this value to the integer power n

Link copied to clipboard
inline operator fun rangeTo(other: UInt128): UInt128Range

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

Link copied to clipboard
operator fun rem(other: UInt128): UInt128
inline operator fun rem(other: UByte): UInt128
inline operator fun rem(other: UInt): UInt128
inline operator fun rem(other: ULong): UInt128
inline operator fun rem(other: UShort): UInt128

Calculates the remainder of truncating division of this value by the other value.

Link copied to clipboard
inline fun UInt128.rotateLeft(bitCount: Int): UInt128

Rotates the binary representation of this UInt128 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.

Link copied to clipboard
inline fun UInt128.rotateRight(bitCount: Int): UInt128

Rotates the binary representation of this UInt128 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.

Link copied to clipboard
infix fun shl(bitCount: Int): UInt128

Shifts this value left by the bitCount number of bits.

Link copied to clipboard
infix fun shr(bitCount: Int): UInt128

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

Link copied to clipboard

Returns a number having a single bit set in the position of the most significant set bit of this UInt128 number, or zero, if this number is zero.

Link copied to clipboard

Returns a number having a single bit set in the position of the least significant set bit of this UInt128 number, or zero, if this number is zero.

Link copied to clipboard
operator fun times(other: UInt128): UInt128

Multiplies this value by the other value.

inline operator fun times(other: UByte): UInt128
inline operator fun times(other: UInt): UInt128
inline operator fun times(other: ULong): UInt128
inline operator fun times(other: UShort): UInt128

Multiplies this value by the other value.

Link copied to clipboard
inline fun toByte(): Byte

Converts this UInt128 value to Byte.

Link copied to clipboard
inline fun toInt(): Int

Converts this UInt128 value to Int.

Link copied to clipboard
inline fun toLong(): Long

Converts this UInt128 value to Long.

Link copied to clipboard
inline fun toShort(): Short

Converts this UInt128 value to Short.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun UInt128.toString(radix: Int): String

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

Link copied to clipboard
inline fun toUByte(): UByte

Converts this UInt128 value to UByte.

Link copied to clipboard
inline fun toUInt(): UInt

Converts this UInt128 value to UInt.

Link copied to clipboard
inline fun toUInt128(): UInt128

Returns this value.

Link copied to clipboard
inline fun toULong(): ULong

Converts this UInt128 value to ULong.

Link copied to clipboard
inline fun toUShort(): UShort

Converts this UInt128 value to UShort.

Link copied to clipboard
operator fun unaryMinus(): UInt128

Returns the negative of this value.

Link copied to clipboard
operator fun unaryPlus(): UInt128

Returns this value.

Link copied to clipboard

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

Link copied to clipboard
infix fun xor(other: UInt128): UInt128

Performs a bitwise XOR operation between the two values.