2009-10-21から1日間の記事一覧

ネイピア数1000桁

1000桁ー。 # coding: utf-8 # exp(1) = sum_0^inf[x / n!] # ネイピア数1000桁 from decimal import Decimal, getcontext getcontext().prec = 1010 n = Decimal("1.0") #n = 1.0 # コメントアウトするとfloatで計算 i = 1 e = 0 pre = None while e !=…