# log

Computes the logarithm of the value x to the given base.

Special cases:

`log(x, b)`

is`NaN`

if either`x`

or`b`

are`NaN`

`log(x, b)`

is`NaN`

when`x < 0`

or`b <= 0`

or`b == 1.0`

`log(+Inf, +Inf)`

is`NaN`

`log(+Inf, b)`

is`+Inf`

for`b > 1`

and`-Inf`

for`b < 1`

`log(0.0, b)`

is`-Inf`

for`b > 1`

and`+Inf`

for`b > 1`

See also logarithm functions for common fixed bases: ln, log10 and log2.

#### Since Kotlin

1.2Computes the logarithm of the value x to the given base.

Special cases:

`log(x, b)`

is`NaN`

if either`x`

or`b`

are`NaN`

`log(x, b)`

is`NaN`

when`x < 0`

or`b <= 0`

or`b == 1.0`

`log(+Inf, +Inf)`

is`NaN`

`log(+Inf, b)`

is`+Inf`

for`b > 1`

and`-Inf`

for`b < 1`

`log(0.0, b)`

is`-Inf`

for`b > 1`

and`+Inf`

for`b > 1`

See also logarithm functions for common fixed bases: ln, log10 and log2.

#### Since Kotlin

1.2Computes the logarithm of the value x to the given base.

Special cases:

`log(x, b)`

is`NaN`

if either`x`

or`b`

are`NaN`

`log(x, b)`

is`NaN`

when`x < 0`

or`b <= 0`

or`b == 1.0`

`log(+Inf, +Inf)`

is`NaN`

`log(+Inf, b)`

is`+Inf`

for`b > 1`

and`-Inf`

for`b < 1`

`log(0.0, b)`

is`-Inf`

for`b > 1`

and`+Inf`

for`b > 1`

See also logarithm functions for common fixed bases: ln, log10 and log2.

#### Since Kotlin

1.2Computes the logarithm of the value x to the given base.

Special cases:

`log(x, b)`

is`NaN`

if either`x`

or`b`

are`NaN`

`log(x, b)`

is`NaN`

when`x < 0`

or`b <= 0`

or`b == 1.0`

`log(+Inf, +Inf)`

is`NaN`

`log(+Inf, b)`

is`+Inf`

for`b > 1`

and`-Inf`

for`b < 1`

`log(0.0, b)`

is`-Inf`

for`b > 1`

and`+Inf`

for`b > 1`

See also logarithm functions for common fixed bases: ln, log10 and log2.

#### Since Kotlin

1.3Computes the logarithm of the value x to the given base.

Special cases:

`log(x, b)`

is`NaN`

if either`x`

or`b`

are`NaN`

`log(x, b)`

is`NaN`

when`x < 0`

or`b <= 0`

or`b == 1.0`

`log(+Inf, +Inf)`

is`NaN`

`log(+Inf, b)`

is`+Inf`

for`b > 1`

and`-Inf`

for`b < 1`

`log(0.0, b)`

is`-Inf`

for`b > 1`

and`+Inf`

for`b > 1`

See also logarithm functions for common fixed bases: ln, log10 and log2.

#### Since Kotlin

1.8Computes the logarithm of the value x to the given base.

Special cases:

`log(x, b)`

is`NaN`

if either`x`

or`b`

are`NaN`

`log(x, b)`

is`NaN`

when`x < 0`

or`b <= 0`

or`b == 1.0`

`log(+Inf, +Inf)`

is`NaN`

`log(+Inf, b)`

is`+Inf`

for`b > 1`

and`-Inf`

for`b < 1`

`log(0.0, b)`

is`-Inf`

for`b > 1`

and`+Inf`

for`b > 1`

See also logarithm functions for common fixed bases: ln, log10 and log2.