Question: 2. e Approximation Your task is to test the performance of an e approximation. Euler's number e 2:71828 can be approximated with the following formula:
2. e Approximation Your task is to test the performance of an e approximation. Euler's number e 2:71828 can be approximated with the following formula: e = 1 0! + 1 1! + 1 2! + 1 3! + : : : (1) Complete the following steps (a) Create a module called eApproximation.py (b) Import the math module to get the factorial() function (c) Import the time module to get the time() function. (d) Write a function e approx(n) that uses an accumulator an returns and approximation of e as given by equation (1) (e) Test the running time of e approx() by running the function with inputs from 100 to 1000 and printing out the results.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
