Why is answers is different?

I have answers of this code of finding Euler number:

import math 

Sn = 0

x = 1

big_n = 10000

for i in range(0,big_n,1):
    Sn = Sn + ((x**i)/(math.factorial(i)))

print(Sn)
print(math.e)

Output:

2.7182818284590455
2.718281828459045

Why is first output is for one digit more than second one?

I think this is because math.e has constant length but teacher says it doesn't

Upvotes: 0

Views: 59

Answers (0)

Related Questions