Hacker News new | ask | show | jobs
by jqpabc123 1554 days ago
Not unique or limited to Python.

Floats (fractions and decimals) are only approximations. It is not possible to represent some of them with complete accuracy within the limits of finite binary storage.

In many cases, scaled integers are a better alternative. For example, when dealing with money/dollars, work with pennies and convert to dollars and cents for display using a simple division/modulus function.