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

相关文章:

  • 2021-09-07
  • 2022-02-08
  • 2021-06-03
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
猜你喜欢
  • 2021-07-11
  • 2021-12-02
  • 2021-07-21
  • 2021-12-02
  • 2021-12-13
  • 2022-12-23
  • 2022-02-20
相关资源
相似解决方案