15 lines
329 B
Python
15 lines
329 B
Python
import math
|
|
from decimal import Decimal, getcontext
|
|
|
|
__author__ = "Jan-Niclas Loosen"
|
|
|
|
|
|
def calc(const):
|
|
summe = Decimal(0)
|
|
for k in range(1, 100):
|
|
summe += (Decimal(const) ** k) / math.factorial(k)
|
|
return summe
|
|
|
|
getcontext().prec = 1000 # Set the precision for Decimal calculations
|
|
print(calc(math.log(2)))
|