Example 1 — Basic log1p() Values
Try log1p() with a few simple inputs and round the results for easy reading.
<?php
echo log1p(0), PHP_EOL;
echo round(log1p(1), 4), PHP_EOL;
echo round(log1p(0.5), 4), PHP_EOL; How It Works
- log1p(0) is log(1), which is 0.
- log1p(1) is log(2), about 0.6931 after rounding.
- log1p(0.5) is log(1.5), about 0.4055 after rounding.
- round() keeps the output short and easy to read.

