PHP exp() Function

Definition

The exp() function returns e raised to the power of x (ex).

'e' is the base of the natural system of logarithms (approximately 2.718282) and x is the number passed to it.

Syntax

PHP exp() Function has the following syntax.

exp(num);

Parameter

ParameterDescription
numRequired. Specifies the exponent

Return

Item Description
Return Value 'e' raised to the power of x
Return Type Float

Example

Return 'e' raised to the power of different numbers:


<?php//from  w w w.  j  a v  a2s .c  om
echo(exp(0) . "\n");
echo(exp(1) . "\n");
echo(exp(10) . "\n");
echo(exp(4.8));
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions