v1.8.21
  • Solutions
    • Multiplatform
    • Server-side
    • Data science
    • Android
  • Docs
  • Community
  • Teach
  • Play
    • Playground
    • Hands-on
    • Examples
    • Koans
← Docs
kotlin-stdlib / kotlin.math / ln1p

ln1p

Common
JVM
JS
Native
1.2
fun ln1p(x: Double): Double
(Common source) (JVM source) (JS source) (Native source)
fun ln1p(x: Float): Float
(Common source) (JVM source) (JS source) (Native source)

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

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Kotlin™ is protected under the Kotlin Foundation and licensed under the Apache 2 license.
Supported and developed by JetBrains