Mathematical Constants
π (pi)
Computed using the Chudnovsky algorithm with binary splitting:
print(Decimal.pi(precision=100)) # 100 digits of π
print(Decimal.pi(precision=1000)) # 1000 digits of π
e (Euler’s number)
Computed as exp(1):
print(Decimal.e(precision=100)) # 100 digits of e
print(Decimal.e(precision=1000)) # 1000 digits of e