countOneBits
fun Int.countOneBits(): Int
Counts the number of set bits in the binary representation of this Int number.
fun Long.countOneBits(): Int
Counts the number of set bits in the binary representation of this Long number.
fun Byte.countOneBits(): Int
Counts the number of set bits in the binary representation of this Byte number.
fun Short.countOneBits(): Int
Counts the number of set bits in the binary representation of this Short number.
fun UInt.countOneBits(): Int
Counts the number of set bits in the binary representation of this UInt number.
fun ULong.countOneBits(): Int
Counts the number of set bits in the binary representation of this ULong number.
fun UByte.countOneBits(): Int
Counts the number of set bits in the binary representation of this UByte number.
fun UShort.countOneBits(): Int
Counts the number of set bits in the binary representation of this UShort number.
© 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/count-one-bits.html