need to calculate with decimals but python show error, but the solution that the book give, don't work!!!
By example if try to sum 0.1 + 0.1 + 0.1 show the classical error but if try:
from decimal import Decimal
d = Decimal(0.1)
d + d + d
The error obtained is:
Decimal('0.3000000000000000166533453694')
what's supposed the solution gives an error, please help, using python 3.8 in openSuse TumbleWeed.
My question is different from the post Is floating point math broken?, that post dont ask about "decimal" library.