Comment on 0.30000000000000004
janAkali@lemmy.one 1 year agoMost languages have decimal libraries to avoid working with floating point numbers.
Comment on 0.30000000000000004
janAkali@lemmy.one 1 year agoMost languages have decimal libraries to avoid working with floating point numbers.
Slotos@feddit.nl 1 year ago
They are as incapable of handling one third of a dollar as binary positional notation is incapable of handling one fifth (0.2).
It’s not really a float problem. It’s a positional notation one. Some perfectly rational numbers refuse to squeeze into that mold.
szczuroarturo@programming.dev 1 year ago
Also decimal system is not exatcly that much better since you also cant write 1/3 in decimal