Change language

PHP exp () function

|
The exp() function is used to calculate the e raised to the power of the given argument.Syntax:
 float exp ($power)
Parameters : The function takes one parameter, $power, which defines the power to be increased e .Return type : This function returns the value e raised to the power of the given argument as a floating point number.Examples:
 Input: $power = 0; Output: 1 Input: $power = 1; Output: 2.718281828459
The following program illustrates how exp() works in PHP:  
// PHP code to illustrate the exp() function for ( $i = -2; $i < = 2; $i ++) echo ’e ^’ . $i . ’=’ . exp ( $i ). "" ;  
?>
Output:
e ^ - 2 = 0.13533528323661 e ^ -1 = 0.36787944117144 e ^ 0 = 1 e ^ 1 = 2.718281828459 e ^ 2 = 7.3890560989307
Important points to pay attention to :
  • The exp() function - a very popular method for calculating exponential values.
  • The log() function is a functional analogue of exp().
Link :
http://php.net/manual/en/function.exp.php