The log1p() function Returns log(1+number), computed in a way that is accurate even when the value of number is close to zero.
Syntax
log1p(val)
Parameters
val − The specified number
Return
The log1p() function Returns log(1+number), computed in a way that is accurate even when the value of number is close to zero.
Example
<?php echo(log1p(1)); ?>
Output
0.69314718055995
Example
Let us see another example −
<?php echo(log1p(0)); ?>
Output
0
Example
Let us see another example −
<?php echo(log1p(10)); echo(log1p(2.7)); ?>
Output
2.39789527279841.3083328196502