0.30000000000000004feddit.deimage Inductor ( @Inductor@feddit.de ) Programmer Humor@programming.dev • 1 year ago message-square30fedilinkarrow-up1284
arrow-up1284image0.30000000000000004feddit.de Inductor ( @Inductor@feddit.de ) Programmer Humor@programming.dev • 1 year ago message-square30fedilink
minus-square janAkali ( @janAkali@lemmy.one ) linkfedilinkEnglish13•edit-21 year agoMost languages have decimal libraries to correctly handle floating point arithmetics, where precision is necessary.
minus-square Slotos ( @Slotos@feddit.nl ) linkfedilink1•1 year 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 ( @szczuroarturo@programming.dev ) linkfedilink1•1 year 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