W3cubDocs

/Kotlin

nextBits

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
abstract fun nextBits(bitCount: Int): Int
fun nextBits(bitCount: Int): Int

Gets the next random bitCount number of bits.

Generates an Int whose lower bitCount bits are filled with random values and the remaining upper bits are zero.

Parameters

bitCount - number of bits to generate, must be in range 0..32, otherwise the behavior is unspecified.

© 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.random/-random/next-bits.html