toUInt

Common
JVM
JS
Native
1.5
fun Byte.toUInt(): UInt
(source)

Converts this Byte value to UInt.

If this value is positive, the resulting UInt value represents the same numerical value as this Byte.

The least significant 8 bits of the resulting UInt value are the same as the bits of this Byte value, whereas the most significant 24 bits are filled with the sign bit of this value.

Common
JVM
JS
Native
1.5
fun Short.toUInt(): UInt
(source)

Converts this Short value to UInt.

If this value is positive, the resulting UInt value represents the same numerical value as this Short.

The least significant 16 bits of the resulting UInt value are the same as the bits of this Short value, whereas the most significant 16 bits are filled with the sign bit of this value.

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

Converts this Int value to UInt.

If this value is positive, the resulting UInt value represents the same numerical value as this Int.

The resulting UInt value has the same binary representation as this Int value.

Common
JVM
JS
Native
1.5
fun Long.toUInt(): UInt
(source)

Converts this Long value to UInt.

If this value is positive and less than or equals to UInt.MAX_VALUE, the resulting UInt value represents the same numerical value as this Long.

The resulting UInt value is represented by the least significant 32 bits of this Long value.

Common
JVM
JS
Native
1.5
fun Float.toUInt(): UInt
(source)

Converts this Float value to UInt.

The fractional part, if any, is rounded down towards zero. Returns zero if this Float value is negative or NaN, UInt.MAX_VALUE if it's bigger than UInt.MAX_VALUE.

Common
JVM
JS
Native
1.5
fun Double.toUInt(): UInt
(source)

Converts this Double value to UInt.

The fractional part, if any, is rounded down towards zero. Returns zero if this Double value is negative or NaN, UInt.MAX_VALUE if it's bigger than UInt.MAX_VALUE.