![]() |
|
Syntactic Confectionery Delight | |
PerlMonks |
Humans have too many fingersby LanX (Saint) |
on Jul 18, 2009 at 12:22 UTC ( #781317=note: print w/replies, xml ) | Need Help?? |
Rule of Thumb:
To calculate dollars "accurately" with 2 decimal places, you need So just calculate with integers in the desired accuracy and shift the decimal point afterwards²!
Background:Floats are not accurate with decimal fractions because the computer "has only two fingers".
ExperimentJust try to express 1/3 accurately in decimal system!And now imagine you're an alien with 3 fingers 4 and you have only computers that calculate in decimal fractions¹... wouldn't this annoy you, too? ConclusionHumans have too many fingers! Downsizing³ to octal system would do it...
Cheers Rolf Footnotes:
In Section
Seekers of Perl Wisdom
|
|