expm1() function in PHP


The expm1() function Returns e raised to the power x - 1 i.e

ex -1

Syntax

expm1(val)

Parameters

  • val − This is the power

Return

The expm1() function Returns e raised to the power x - 1

Example

 Live Demo

<?php
   echo(expm1(0) . "<br>");
   echo(expm1(1));
?>

Output

0<br>1.718281828459

Let us see another example −

Example

 Live Demo

<?php
   $val = 1;
   echo "e^", $val, "-1 = ", expm1($val);
?>

Output

e^1-1 = 1.718281828459

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 26-Jun-2020

19 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements