This is a video that will help you calculate euler’s number, which is an irrational number… I’m having a little trouble with the function because it’s totally ignoring the precision (which is the number that the user gives, but it does calculate euler’s number correctly.
Here is the code:
using namespace std;
float factorial(int n)
float calculate_e(float precision)
} while(abs (e-previous)>precision);
cout<<“How many decimals of accuracy do you want? “;
cout<<“The estimation of e with “<<precision<<” decimal points is: “<<calculate_e(precision)<<endl;