Hacker News new | ask | show | jobs
by voxic11 1814 days ago
Standard floats cannot represent very common numbers such as 0.1 exactly so they are generally disfavored for financial calculations where an approximated result is often unacceptable.

> For example, the non-representability of 0.1 and 0.01 (in binary) means that the result of attempting to square 0.1 is neither 0.01 nor the representable number closest to it.

https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accu...