# log1p() Function & Examples

Use the log1p() arithmetic function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## log1p

#### log1p(x)

#### log1p(x, base)

Try it yourself:

```calculio
log1p(2.5)
exp(log1p(1.4))
pow(10, 4)
log1p(9999, 10)
log1p(9999) / log(10)
```

[exp](https://calcul.io/function/exp/index.md)

[log](https://calcul.io/function/log/index.md)

[log2](https://calcul.io/function/log2/index.md)

[log10](https://calcul.io/function/log10/index.md)

---

## log1p(): Accurate log(1 + x)

**log1p()** calculates log(1+x) with improved accuracy when x is close to zero. Directly adding a tiny x to 1 can lose significant digits in floating-point arithmetic, making log1p preferable in numerical and statistical formulas.

## Domain and use

For real arithmetic, x must be greater than −1. log1p(0) is zero. It is useful for small percentage changes, probability formulas, and stable transformations. Its natural companion is [expm1()](https://calcul.io/function/expm1/index.md), which accurately calculates exp(x)−1.

Use [log()](https://calcul.io/function/log/index.md) for ordinary values where the expression is not specifically 1+x. For very small inputs, retain full precision and avoid rounding until output with [format()](https://calcul.io/function/format/index.md).

[All functions](https://calcul.io/functions/index.md)
