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

exp() function in PHP

Thisexp()The function returns e x. This raises e to the power x.

Here,

'e' is 2.718282
x is the power

Syntax

exp(x)

parameter

  • x = exponent

returns

Thisexp()The function returns e to the power of x, which is a floating-point value.

Example

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

Output Result

1<br>2.718281828459

Let's see another example-

Example

<?php
   echo(exp(2)  .  "<br>");
   echo(exp(5)  .  "<br>");
   echo(exp(20));
?>

Output Result

7.3890560989307<br>148.41315910258<br>485165195.40979