exp() function C++

The exp() function in C++ returns the exponential (Euler’s number) e (or 2.71828) raised to the given argument.

Syntax for returning exponential e:
result=exp()

Parameter:
The function can take any value i.e, positive, negative or zero in its parameter and returns result in int, double or float or long double.



Return Value:
The exp() function returns the value in the range of [0, inf].

Error:
It shows error when we pass more then one argument in exp function

Application:
Given below is an example of application of exp() function

filter_none

edit
close

play_arrow

link
brightness_4
code

#include <bits/stdc++.h>
using namespace std;
  
// function to explain use of exp() function
double application(double x)
{
    double result = exp(x);
    cout << "exp(x) = " << result << endl;
}
  
// driver program
int main()
{
    double x = 10;
    cout << application(x);
    return 0;
}
chevron_right

Output:

exp(x) = 22026.5

Applications of e (mathematical constant):

Source : Wiki




Striver(underscore)79 at Codechef and codeforces D

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
C++
Practice Tags :