log1p() function in PHP

PHPProgrammingServer Side Programming

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

 Live Demo

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

Output

0.69314718055995

Example

Let us see another example −

 Live Demo

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

Output

0

Example

Let us see another example −

 Live Demo

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

Output

2.39789527279841.3083328196502
raja
Updated on 27-Dec-2019 06:52:28

Advertisements