python 数字计算模块 decimal(小数计算)

from decimal import *

a = Decimal('0.1')+Decimal('0.1')+Decimal('0.1')+Decimal('0.3')

float(a)

>>>>>0.6

 

posted @ 2018-05-29 10:10  shmily3929  阅读(2011)  评论(0编辑  收藏  举报