Use common implementation of fastLog2 based on countLeadingZeroBits
This commit is contained in:
@@ -28,9 +28,6 @@ public fun java.util.Random.asKotlinRandom(): Random =
|
||||
internal actual inline fun defaultPlatformRandom(): Random =
|
||||
IMPLEMENTATIONS.defaultPlatformRandom()
|
||||
|
||||
internal actual fun fastLog2(value: Int): Int =
|
||||
31 - Integer.numberOfLeadingZeros(value)
|
||||
|
||||
internal actual fun doubleFromParts(hi26: Int, low27: Int): Double =
|
||||
(hi26.toLong().shl(27) + low27) / (1L shl 53).toDouble()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user