安装
pip3 install PyDecimal
from decimal import Decimal
a=0.1
b=0.2
print(Decimal(str(a))+Decimal(str(b))) # 0.3
安装
pip3 install PyDecimal
from decimal import Decimal
a=0.1
b=0.2
print(Decimal(str(a))+Decimal(str(b))) # 0.3