Example 1 — Simple expm1() results
Compare a few small calculations.
<?php
echo expm1(0) . PHP_EOL;
echo round(expm1(1), 4) . PHP_EOL;
echo round(expm1(2), 4) . PHP_EOL; How It Works
- expm1(0) is exp(0) - 1, which is 1 - 1 = 0.
- expm1(1) is e - 1, about 1.7183.
- expm1(2) is e squared minus 1, about 6.3891.
- round() keeps the printed values neat.

