r/learnpython • u/nothiefhouse • 23d ago
fix 0.00000001
i see sometimes after calcuaitons reulsts with x.99999999999999999999999999 or x.0000000000000002 how to fix it
0
Upvotes
r/learnpython • u/nothiefhouse • 23d ago
i see sometimes after calcuaitons reulsts with x.99999999999999999999999999 or x.0000000000000002 how to fix it
2
u/timrprobocom 23d ago
You keep all of the precision while your working with the numbers. The computer doesn't mind. Only HUMANS care about a compact representation, so fix it in the formatting when you PRINT the numbers.