发布时间:2019-07-30 10:52:59编辑:auto阅读(2555)
计算高精确度的浮点数方法
借助decimal模块的”getcontext”和”Decimal”方法
from decimal import *
getcontext().prec = 50 #50精度
a = Decimal(1) / Decimal(3)
a
Decimal(‘0.333333333333……’)
上一篇: VIM PYTHON 调试
下一篇: Python 美化打印 json 数据
54083
40845
35357
31013
25904
25641
24079
19607
15684
15163
1899°
1747°
1837°
1916°
1909°
2080°
2040°
1864°
1951°
1935°