toULong

Common
JVM
JS
Native
1.5
fun Byte.toULong(): ULong
(source)

Converts this Byte value to ULong.

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

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

Common
JVM
JS
Native
1.5
fun Short.toULong(): ULong
(source)

Converts this Short value to ULong.

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

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

Common
JVM
JS
Native
1.5
fun Int.toULong(): ULong
(source)

Converts this Int value to ULong.

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

The least significant 32 bits of the resulting ULong value are the same as the bits of this Int value, whereas the most significant 32 bits are filled with the sign bit of this value.

Common
JVM
JS
Native
1.5
fun Long.toULong(): ULong
(source)

Converts this Long value to ULong.

If this value is positive, the resulting ULong value represents the same numerical value as this Long.

The resulting ULong value has the same binary representation as this Long value.

Common
JVM
JS
Native
1.5
fun Float.toULong(): ULong
(source)

Converts this Float value to ULong.

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

Common
JVM
JS
Native
1.5
fun Double.toULong(): ULong
(source)

Converts this Double value to ULong.

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