W3cubDocs

/Kotlin

ln1p

Platform and version requirements: JVM (1.2), JS (1.2), Native (1.2)
fun ln1p(x: Double): Double

Computes ln(x + 1).

This function can be implemented to produce more precise result for x near zero.

Special cases:

  • ln1p(NaN) is NaN
  • ln1p(x) is NaN where x < -1.0
  • ln1p(-1.0) is -Inf
  • ln1p(+Inf) is +Inf

See Also

ln

expm1

Platform and version requirements: JVM (1.2), JS (1.2), Native (1.2)
fun ln1p(x: Float): Float

Computes ln(a + 1).

This function can be implemented to produce more precise result for x near zero.

Special cases:

  • ln1p(NaN) is NaN
  • ln1p(x) is NaN where x < -1.0
  • ln1p(-1.0) is -Inf
  • ln1p(+Inf) is +Inf

See Also

ln

expm1

© 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.math/ln1p.html