136k views
20 votes
Using the Mclaurin’s series only, prove categorically that e=2.71828

User Sthenault
by
4.7k points

1 Answer

6 votes

Answer:

import math

e = n = 0

while(round(e, 5) != 2.71828):

e = e + 1/math.factorial(n)

print(n, e)

n = n + 1

Step-by-step explanation:

Above McLaurin series implementation shows that you approximate e to 5 decimals already after 8 iterations.

User Btreat
by
5.1k points