toULong

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

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.3
fun Short.toULong(): ULong

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.3
fun Int.toULong(): ULong

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.3
fun Long.toULong(): ULong

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.3
fun Float.toULong(): ULong

Converts this Float value to ULong.

The fractional part, if any, is rounded down. 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.3
fun Double.toULong(): ULong

Converts this Double value to ULong.

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