Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP log1p() Function

PHP log1p() Function

PHP Math Reference Manual PHP Math Reference Manual

Example

Return log(1+number) for different numbers:

"); echo(log1p(2) . "
"); echo(log1p(1) . "
"); echo(log1p(0)); ?>

Run Example »


Definition and Usage

The log1p() function returns log(1+number), even when number is close to zero, an accurate result can still be computed.


Syntax

log1p(

number

);

Parameters Description
number Required. Specifies the number to process.

Technical Details

Return Value: log(1+number)
Return Type: Float
PHP Version: 4.1+
PHP Changelog: PHP 5.3: The log1p() function is available on all platforms.

PHP Math Reference Manual PHP Math Reference Manual