Inductor to Programmer Humor@programming.dev • 2 years ago0.30000000000000004feddit.deimagemessage-square64fedilinkarrow-up1444arrow-down116
arrow-up1428arrow-down1image0.30000000000000004feddit.deInductor to Programmer Humor@programming.dev • 2 years agomessage-square64fedilink
minus-squarejanAkalilinkfedilinkEnglish20•edit-22 years agoMost languages have decimal libraries to correctly handle floating point arithmetics, where precision is necessary.
minus-square@Slotos@feddit.nllinkfedilink1•2 years agoThey 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.
minus-square@szczuroarturo@programming.devlinkfedilink1•2 years agoAlso decimal system is not exatcly that much better since you also cant write 1/3 in decimal
Most languages have decimal libraries to correctly handle floating point arithmetics, where precision is necessary.
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.
Also decimal system is not exatcly that much better since you also cant write 1/3 in decimal