English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

log in PHP1p() function

log1The p() function returns log(1 + number), even if the value of the number is close to zero, it is calculated accurately.

Syntax

log1p(val)

parameter

  • val-the specified number

returns

log1The p() function returns log(1 + number), even if the value of the number is close to zero, it is calculated accurately.

Example

<?php
   echo(log1p(1));
?>

Output Result

0.69314718055995

Example

Let's look at another example-

<?php
   echo(log1p(0));
?>

Output Result

0

Example

Let's look at another example-

<?php
   echo(log1p(10));
   echo(log1p(2.7));
?>

Output Result

2.39789527279841.3083328196502