takeHighestOneBit

Common
inline fun UInt.takeHighestOneBit(): UInt

Returns a number having a single bit set in the position of the most significant set bit of this UInt number, or zero, if this number is zero.

Since Kotlin

1.5
Common
inline fun ULong.takeHighestOneBit(): ULong

Returns a number having a single bit set in the position of the most significant set bit of this ULong number, or zero, if this number is zero.

Since Kotlin

1.5
Common
inline fun UByte.takeHighestOneBit(): UByte

Returns a number having a single bit set in the position of the most significant set bit of this UByte number, or zero, if this number is zero.

Since Kotlin

1.5
Common
inline fun UShort.takeHighestOneBit(): UShort

Returns a number having a single bit set in the position of the most significant set bit of this UShort number, or zero, if this number is zero.

Since Kotlin

1.5
Common
inline fun Byte.takeHighestOneBit(): Byte

Returns a number having a single bit set in the position of the most significant set bit of this Byte number, or zero, if this number is zero.

Since Kotlin

1.4
Common
inline fun Short.takeHighestOneBit(): Short

Returns a number having a single bit set in the position of the most significant set bit of this Short number, or zero, if this number is zero.

Since Kotlin

1.4
Common
fun Int.takeHighestOneBit(): Int

Returns a number having a single bit set in the position of the most significant set bit of this Int number, or zero, if this number is zero.

Since Kotlin

1.4
inline fun Int.takeHighestOneBit(): Int

Returns a number having a single bit set in the position of the most significant set bit of this Int number, or zero, if this number is zero.

Since Kotlin

1.4
JS
fun Int.takeHighestOneBit(): Int

Returns a number having a single bit set in the position of the most significant set bit of this Int number, or zero, if this number is zero.

Since Kotlin

1.4
Native
fun Int.takeHighestOneBit(): Int

Returns a number having a single bit set in the position of the most significant set bit of this Int number, or zero, if this number is zero.

Since Kotlin

1.4
Common
fun Long.takeHighestOneBit(): Long

Returns a number having a single bit set in the position of the most significant set bit of this Long number, or zero, if this number is zero.

Since Kotlin

1.4
inline fun Long.takeHighestOneBit(): Long

Returns a number having a single bit set in the position of the most significant set bit of this Long number, or zero, if this number is zero.

Since Kotlin

1.4
JS
fun Long.takeHighestOneBit(): Long

Returns a number having a single bit set in the position of the most significant set bit of this Long number, or zero, if this number is zero.

Since Kotlin

1.4
Native
fun Long.takeHighestOneBit(): Long

Returns a number having a single bit set in the position of the most significant set bit of this Long number, or zero, if this number is zero.

Since Kotlin

1.4