发布时间:2019-07-30 10:52:59编辑:auto阅读(2100)
计算高精确度的浮点数方法
借助decimal模块的”getcontext”和”Decimal”方法
from decimal import *
getcontext().prec = 50 #50精度
a = Decimal(1) / Decimal(3)
a
Decimal(‘0.333333333333……’)
上一篇: VIM PYTHON 调试
下一篇: Python 美化打印 json 数据
51272
50713
41317
38129
32591
29500
28351
23215
23184
21507
1584°
2304°
1912°
1854°
2174°
1897°
2587°
4326°
4176°
2980°