toULong
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.
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.
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.
fun Long.toULong(): ULong
fun Float.toULong(): ULong
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
.
fun Double.toULong(): ULong
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
.
© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/to-u-long.html