The value of Exponential function can be calculated using Taylor Series.
= 1 + x/1! + /2! + /3! + ......
To find its value using recursion, we will use static variables. For the power of x we will use p and for factorials we will use f as static variables.
The function shown below is used to increase the power of x.
p = p*x
The function below is used to find factorials.
f = f*n
The function below is used to calculate the summation of the series.
where r is the recursive call to the function.
Below is the implementation of the above idea.
- Tail recursion to calculate sum of array elements.
- C program to calculate the value of nPr
- Program to calculate value of nCr
- Program to calculate the value of nCr Efficiently
- Efficient program to calculate e^x
- Program to calculate the value of sin(x) and cos(x) using Expansion
- Write a program to calculate pow(x,n)
- Program for length of a string using recursion
- C++ Program to print an Array using Recursion
- Program to calculate distance between two points in 3 D
- Program to calculate distance between two points
- Program to calculate the area of Kite
- Program to calculate GST from original and net prices
- Program to calculate Profit Or Loss
- Program to calculate Area Of Octagon
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.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.