log1p() function in PHP


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

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 27-Dec-2019

57 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements