精度

 

 

>>> from decimal import Decimal >>> a = 0.1 >>> b = 0.2 >>> c = float(Decimal(str(a)) + Decimal(str(b))) >>> c 0.3

posted @ 2022-02-17 15:57  walkerpython  阅读(49)  评论(0编辑  收藏  举报