PHP log1p() Function

Definition

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

PHP log1p() Function has the following syntax.

log1p(number);

Parameter

ParameterIs Required Description
numberRequired.Number to process

Return

Item Description
Return Value log(1+number)
Return TypeFloat

Example

Return log(1+number) for different numbers:


<?php/*from   w w w .j  a  v  a 2s . co  m*/
echo(log1p(2.7183) . "\n");
echo(log1p(2) . "\n");
echo(log1p(1) . "\n");
echo(log1p(0));
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions