log2

Common
fun log2(x: Double): Double
fun log2(x: Float): Float

Computes the binary logarithm (base 2) of the value x.

Since Kotlin

1.2

See also

ln

function for special cases.

fun log2(x: Double): Double
fun log2(x: Float): Float

Computes the binary logarithm (base 2) of the value x.

Since Kotlin

1.2

See also

ln

function for special cases.

JS
inline fun log2(x: Double): Double
inline fun log2(x: Float): Float

Computes the binary logarithm (base 2) of the value x.

Since Kotlin

1.2

See also

ln

function for special cases.

Native
external fun log2(x: Double): Double
external fun log2(x: Float): Float

Computes the binary logarithm (base 2) of the value x.

Since Kotlin

1.2

See also

ln

actual function for special cases.