python学习——浮点数运算出现越界

 如果出现越界,用以下方式避

from decimal import Decimal

Decimal('0.1')+Decimal('0.2)

posted @ 2020-07-18 09:13  KellyWu  阅读(361)  评论(0编辑  收藏  举报