UInt

Common
JVM
JS
Native
1.5
inline class UInt : Comparable<UInt>
(source)

Functions

Common
JVM
JS
Native
1.0

and

Performs a bitwise AND operation between the two values.

infix fun and(other: UInt): UInt
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

Returns this value decremented by one.

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

div

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

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

floorDiv

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

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

inc

Returns this value incremented by one.

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

inv

Inverts the bits in this value.

fun inv(): UInt
Common
JVM
JS
Native
1.0

minus

Subtracts the other value from this value.

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

mod

Calculates the remainder of flooring division of this value (dividend) by the other value (divisor).

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

or

Performs a bitwise OR operation between the two values.

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

plus

Adds the other value to this value.

operator fun plus(other: UByte): UInt
operator fun plus(other: UShort): UInt
operator fun plus(other: UInt): UInt
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: UInt): UIntRange
Common
JVM
JS
Native
1.9

rangeUntil

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

operator fun rangeUntil(other: UInt): UIntRange
Common
JVM
JS
Native
1.0

rem

Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).

operator fun rem(other: UByte): UInt
operator fun rem(other: UShort): UInt
operator fun rem(other: UInt): UInt
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): UInt
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): UInt
Common
JVM
JS
Native
1.0

times

Multiplies this value by the other value.

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

toByte

Converts this UInt value to Byte.

fun toByte(): Byte
Common
JVM
JS
Native
1.0

toDouble

Converts this UInt value to Double.

fun toDouble(): Double
Common
JVM
JS
Native
1.0

toFloat

Converts this UInt value to Float.

fun toFloat(): Float
Common
JVM
JS
Native
1.0

toInt

Converts this UInt value to Int.

fun toInt(): Int
Common
JVM
JS
Native
1.0

toLong

Converts this UInt value to Long.

fun toLong(): Long
Common
JVM
JS
Native
1.0

toShort

Converts this UInt 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 UInt value to UByte.

fun toUByte(): UByte
Common
JVM
JS
Native
1.0

toUInt

Returns this value.

fun toUInt(): UInt
Common
JVM
JS
Native
1.0

toULong

Converts this UInt value to ULong.

fun toULong(): ULong
Common
JVM
JS
Native
1.0

toUShort

Converts this UInt 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: UInt): UInt

Companion Object Properties

Common
JVM
JS
Native
1.0

MAX_VALUE

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

const val MAX_VALUE: UInt
Common
JVM
JS
Native
1.0

MIN_VALUE

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

const val MIN_VALUE: UInt
Common
JVM
JS
Native
1.0

SIZE_BITS

The number of bits used to represent an instance of UInt 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 UInt 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 UInt.coerceAtLeast(minimumValue: UInt): UInt
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 UInt.coerceAtMost(maximumValue: UInt): UInt
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 UInt.coerceIn(
    minimumValue: UInt,
    maximumValue: UInt
): UInt
fun <T : Comparable<T>> T.coerceIn(
    minimumValue: T?,
    maximumValue: T?
): T

Ensures that this value lies in the specified range.

fun UInt.coerceIn(range: ClosedRange<UInt>): UInt
fun <T : Comparable<T>> T.coerceIn(
    range: ClosedFloatingPointRange<T>
): T
fun <T : Comparable<T>> T.coerceIn(range: ClosedRange<T>): T
Common
JVM
JS
Native
1.6

compareTo

Compares this object with the specified object for order. Returns zero if this object is equal to the specified other object, a negative number if it's less than other, or a positive number if it's greater than other.

infix fun <T> Comparable<T>.compareTo(other: T): Int
Native
1.3

convert

fun <R : Any> UInt.convert(): R
Common
JVM
JS
Native
1.5

countLeadingZeroBits

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

fun UInt.countLeadingZeroBits(): Int
Common
JVM
JS
Native
1.5

countOneBits

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

fun UInt.countOneBits(): Int
Common
JVM
JS
Native
1.5

countTrailingZeroBits

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

fun UInt.countTrailingZeroBits(): Int
Common
JVM
JS
Native
1.5

downTo

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

infix fun UInt.downTo(to: UInt): UIntProgression
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.9

rangeUntil

Creates an open-ended range from this Comparable value to the specified that value.

operator fun <T : Comparable<T>> T.rangeUntil(
    that: T
): OpenEndRange<T>
Common
JVM
JS
Native
1.6

rotateLeft

Rotates the binary representation of this UInt 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 UInt.rotateLeft(bitCount: Int): UInt
Common
JVM
JS
Native
1.6

rotateRight

Rotates the binary representation of this UInt 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 UInt.rotateRight(bitCount: Int): UInt
Common
JVM
JS
Native
1.5

takeHighestOneBit

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

fun UInt.takeHighestOneBit(): UInt
Common
JVM
JS
Native
1.5

takeLowestOneBit

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

fun UInt.takeLowestOneBit(): UInt
Common
JVM
JS
Native
1.9

toHexString

Formats this UInt value using the specified format.

fun UInt.toHexString(
    format: HexFormat = HexFormat.Default
): String
Common
JVM
JS
Native
1.5

toString

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

fun UInt.toString(radix: Int): String
Common
JVM
JS
Native
1.5

until

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

infix fun UInt.until(to: UInt): UIntRange