PHP expm1() Function Last Updated : 22 Jun, 2023 Comments Improve Suggest changes Like Article Like Report Euler’s Number or commonly known as e is a very popular irrational number which approximates to 2.718281828 and is one of the most important mathematical constants. e is the base of the Natural system of logarithms. The exponential values are broadly used in many occasions such as Compound Interests, Bernoulli trials, Normal Distribution, Calculus and many more. The expm1() function is an inbuilt function in PHP and is used to calculate e raised to the power of the given argument minus one. Syntax: float expm1($power) Parameter: This function takes a single parameter $power which defines the power e has to be raised to. Return Value: This function returns a floating point value which is the value of e raised to the $power of the given argument -1. That is, it will return (e$power-1). Examples: Input : $power = 1 Output : (e1-1) = 1.718281828459 Input : $power = 0 Output : (e0-1) = 0 Below programs illustrate the expm1() function in PHP: Program 1: PHP program to demonstrate the expm1() function. php <?php // PHP program to demonstrate the expm1() function $n1 = 1; $n2 = 0; //prints value of e^1 - 1 echo "e^", $n1, "-1 = ", expm1($n1), "\n"; //prints value of e^0 - 1 echo "e^", $n2, "-1 = ", expm1($n2), "\n"; ?> Output: e^1-1 = 1.718281828459 e^0-1 = 0 Program 2: PHP program to demonstrate the expm1() function using an array. php <?php // PHP code to illustrate the working // of expm1() Function // input array $array = array(2, 3, 1, 5); // print all the e^x-1 value in the arrays foreach($array as $i) echo 'e^'.$i.'-1 = '.expm1($i)."\n"; ?> Output: e^2-1 = 6.3890560989307 e^3-1 = 19.085536923188 e^1-1 = 1.718281828459 e^5-1 = 147.41315910258 Reference: http://php.net/manual/en/function.expm1.php Comment More infoAdvertise with us Next Article PHP expm1() Function S Striver Follow Improve Article Tags : Misc Web Technologies PHP PHP-basics Practice Tags : Misc Similar Reads PHP | exit( ) Function The exit() function in PHP is an inbuilt function which is used to output a message and terminate the current script. The exit() function only terminates the execution of the script. The shutdown functions and object destructors will always be executed even if exit() function is called. The message 2 min read PHP end() Function The end() function is an inbuilt function in PHP and is used to find the last element of the given array. The end() function changes the internal pointer of an array to point to the last element and returns the value of the last element.Syntax:end($array)Parameters:This function accepts a single par 2 min read PHP eval() Function PHP eval() function in PHP is an inbuilt function that evaluates a string as PHP code. Syntax: eval( $string ) Parameters: This function accepts a single parameter as shown in the above syntax and described below. $string: It must consist of a valid PHP code to be evaluated but should not contain op 2 min read PHP | fileperms( ) Function The fileperms() function in PHP is an inbuilt function which is used to return the permissions given to a file or a directory. The filename of the file whose permissions have to be checked is sent as a parameter to the function and it returns the permissions given to the file in the form of numbers 2 min read PHP | ftell( ) Function The ftell() function in PHP is an inbuilt function which is used to return the current position in an open file. The file is sent as a parameter to the ftell() function and it returns the current file pointer position on success, or FALSE on failure.Syntax:  ftell( $file ) Parameters Used: The ftel 2 min read PHP | Functions A function in PHP is a self-contained block of code that performs a specific task. It can accept inputs (parameters), execute a set of statements, and optionally return a value. PHP functions allow code reusability by encapsulating a block of code to perform specific tasks.Functions can accept param 8 min read PHP define() Function The define() function is basically used by programmers to create constant. Constants in PHP are very similar to variables and the only difference between both are the values of constants can not be changed once it is set in a program. define() returns a Boolean value. It will return TRUE on success 2 min read PHP | gmp_com() Function The gmp_com() is an inbuilt function in PHP which is used to calculate the one's complement of a GMP number(GNU Multiple Precision : For large numbers). Syntax: gmp_com($num) Parameters: This function accepts a GMP number $num as a mandatory parameter as shown in the above syntax. This parameter can 2 min read PHP | gmp_cmp() Function The gmp_cmp() is an inbuilt function in PHP which is used to compare two GMP numbers(GNU Multiple Precision : For large numbers). Syntax: gmp_cmp($num1, $num2) Parameters: This function accepts two GMP numbers $num1 and $num2 as mandatory parameters as shown in the above syntax for comparing. These 2 min read PHP current() Function The current() function is an inbuilt function in PHP. It is used to return the value of the element in an array which the internal pointer is currently pointing to.The current() function does not increment or decrement the internal pointer after returning the value.In PHP, all arrays have an interna 2 min read Like