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
- Write a program to calculate pow(x,n)
- Efficient program to calculate e^x
- Program to calculate the value of nCr Efficiently
- Program to calculate the value of sin(x) and cos(x) using Expansion
- C++ Program to print an Array using Recursion
- Program for length of a string using recursion
- Program to calculate Root Mean Square
- Program to calculate the area of Kite
- Program to calculate distance between two points
- Program to calculate distance between two points in 3 D
- Program to calculate GST from original and net prices
- 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.