Math Functions

math.log1p()

Compute the natural logarithm of 1+x accurately near zero. The real domain requires x greater than -1.

Formal Syntax & Structure

python syntaxpython
math.log1p(x, /)

Parameters & Attributes

NameTypeDescription
xreal numberInput real value.

Return Value

float

Floating-point result; finite precision and domain restrictions apply.

Working Example

Example Snippetpython
import mathprint(math.log1p(0))
Python Reference