The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: 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 reply to Humans have too many fingers
by LanX
|
|