This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def get_e(): | |
from decimal import Decimal, getcontext | |
getcontext().prec = 200 # improve precision | |
e, f, n = Decimal(0), Decimal(1), Decimal(1) | |
while True: | |
old_e = e | |
e += Decimal(1) / f |