Return log(1+number) of different numbers:
<?phpecho(log1p(2.7183) . "<br>");echo(log1p(2) . "<br>");echo(log1p(1) . "<br>");echo(log1p(0) );?>The log1p() function returns log(1+number) and can calculate accurate results even when number is close to zero.
log1p( number );
parameter | describe |
---|---|
number | Required. Specifies the number to be processed. |
Return value: | log(1+number) |
---|---|
Return type: | Float |
PHP version: | 4.1+ |
PHP change log: | PHP 5.3: The log1p() function is available on all platforms. |