W3cubDocs

/Kotlin

countOneBits

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@ExperimentalUnsignedTypes fun UInt.countOneBits(): Int

Counts the number of set bits in the binary representation of this UInt number.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@ExperimentalUnsignedTypes fun ULong.countOneBits(): Int

Counts the number of set bits in the binary representation of this ULong number.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@ExperimentalUnsignedTypes fun UByte.countOneBits(): Int

Counts the number of set bits in the binary representation of this UByte number.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@ExperimentalUnsignedTypes fun UShort.countOneBits(): Int

Counts the number of set bits in the binary representation of this UShort number.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
fun Int.countOneBits(): Int

Counts the number of set bits in the binary representation of this Int number.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
fun Long.countOneBits(): Int

Counts the number of set bits in the binary representation of this Long number.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
fun Byte.countOneBits(): Int

Counts the number of set bits in the binary representation of this Byte number.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
fun Short.countOneBits(): Int

Counts the number of set bits in the binary representation of this Short number.

© 2010–2020 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