Arithmetic error? Bug?

Well, sort of, but no.

Sort of, because at first sight it looks wrong. At least from a purely
mathematical perspective and because we kind of think computers are
purely methematical.

But no, because this is not even a computer issue. Take for example
the problem of dividing 1 by 3. The decimal result is 0.333333333...
The elipsis (...) indicating that there's an infinite number of
repeating digits. If you add the result three times, you get
0.999999999... Funny, isn't it, shouldn't the answer be 1? An engineer
or physicist would recognize your problem as converting inches to
meters, because of the 0.0254. However, they know how to deal with
precision. So the computation would NOT be:

102 +/- 0 * 0.0254 +/- 0 (exact) = 2.5907999999999998 +/- 0 (INACCURATE answer)

it would be

102 +/- 0.01 * 0.0254 +/- 0 (exact) = 2.5907999999999998 +/- 0.01
(ACCURATE answer)

Notice that the conversion factor, 0.0254 is exact, but the value in
inches is not. In this case I've chosen a precision of +/- 0.01
inches.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to