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
Updated on: 2020-06-26T09:47:39+05:30

66 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements