Some dumb guy <(E-Mail Removed)> wrote:
>After all these years does the MS Calculator applet *still* have a bug?
>
>I tried the following:
>
>3,600,523 divided by 6,000,000,000
>
>The answer I get is: 6.0008716666666666666666666666667e-4
>
>Can anyone recommend a simple freeware arithmetic calculator to replace
>this unbelievably buggy MS POS?
No bugs, that's just the way floating point arithmetic works on *any*
computer. Floating point numbers are approximations. The two you
created probably have little enough precision that they can be
represented exactly. The result of the division is a fraction, and
that pretty surely cannot be represented exactly. Floating point
numbers in *any* computer are binary, and translating decimal
fractions to binary cannot always be done precisely. You can't
represent 1/3 as a decimal fraction, you get .333333 with an infinite
number of threes. Similarly, you can't represent 1/10 as a binary
fraction. The more digits you display in your answer, the more likely
this kind of inexactitude is likely to show up.
Your answer, written as a decimal fraction without the trailing
exponent is:
..000600087
rounded to the nearest 1 billionth. How much precision do you need?
--
Tim Slattery
MS MVP(DTS)
(E-Mail Removed)
http://members.cox.net/slatteryt