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: 1 1 1 1 0! 2! 3! es + + + + (1) Complete the following steps (a) Create a module called Approximation, 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 approxn) that uses an accumulator an returns and ap- proximation 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
