UInt

An unsigned 32-bit integer with values from zero through 4,294,967,295.

Integer arithmetic wraps on overflow. Division and remainder use unsigned magnitudes and throw ArithmeticException for a zero divisor. Shifts fill with zeros and mask the count to its lowest five bits. Signed conversions can reinterpret the high bit as a sign bit.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
infix external fun and(other: UInt): UInt

Returns the bitwise AND of this value and other.

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

Compares this value with other after numeric promotion.

Link copied to clipboard
operator external fun dec(): UInt

Returns this value minus one.

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

Divides this value by other.

Link copied to clipboard
infix fun UInt.downTo(other: UByte): UIntProgression
infix fun UInt.downTo(other: UInt): UIntProgression
infix fun UInt.downTo(other: ULong): ULongProgression
infix fun UInt.downTo(other: UShort): UIntProgression

Creates a descending progression from this value down to other, inclusive.

Link copied to clipboard
operator external fun inc(): UInt

Returns this value plus one.

Link copied to clipboard
external fun inv(): UInt

Inverts all 32 bits of this value.

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

Subtracts other from this value.

Link copied to clipboard
infix external fun or(other: UInt): UInt

Returns the bitwise OR of this value and other.

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

Adds other to this value.

Link copied to clipboard
operator fun UInt.rangeTo(other: UByte): UIntRange
operator fun UInt.rangeTo(other: UInt): UIntRange
operator fun UInt.rangeTo(other: ULong): ULongRange
operator fun UInt.rangeTo(other: UShort): UIntRange

Creates an ascending range from this value up to other, inclusive.

Link copied to clipboard
operator fun UInt.rangeUntil(other: UByte): UIntRange
operator fun UInt.rangeUntil(other: UInt): UIntRange
operator fun UInt.rangeUntil(other: ULong): ULongRange
operator fun UInt.rangeUntil(other: UShort): UIntRange

Creates an ascending range from this value up to other, exclusive.

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

Returns the remainder after dividing this value by other.

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

Shifts this value left, discarding bits that leave the value and filling low bits with zeros.

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

Shifts this value right, filling high bits with zeros.

Link copied to clipboard
operator external fun times(other: UByte): UInt
operator external fun times(other: UInt): UInt
operator external fun times(other: ULong): ULong
operator external fun times(other: UShort): UInt

Multiplies this value by other.

Link copied to clipboard
external fun toByte(): Byte

Converts this value to Byte.

Link copied to clipboard
external fun toDouble(): Double

Converts this value to Double.

Link copied to clipboard
external fun toFloat(): Float

Converts this value to Float.

Link copied to clipboard
external fun toInt(): Int

Converts this value to Int.

Link copied to clipboard
external fun toLong(): Long

Converts this value to Long.

Link copied to clipboard
external fun toShort(): Short

Converts this value to Short.

Link copied to clipboard
external fun toUByte(): UByte

Converts this value to UByte.

Link copied to clipboard
external fun toUInt(): UInt

Returns this value unchanged.

Link copied to clipboard
external fun toULong(): ULong

Converts this value to ULong.

Link copied to clipboard
external fun toUShort(): UShort

Converts this value to UShort.

Link copied to clipboard
infix fun UInt.until(other: UByte): UIntRange
infix fun UInt.until(other: UInt): UIntRange
infix fun UInt.until(other: ULong): ULongRange
infix fun UInt.until(other: UShort): UIntRange

Creates an ascending range from this value up to other, exclusive.

Link copied to clipboard
infix external fun xor(other: UInt): UInt

Returns the bitwise exclusive OR of this value and other.