Yes, that's how it works in the wonderful world of computers.

Floating point math is inexact, because numbers are represented in binary
base, and those fractional numbers that look nice and round in decimal often
don't have nice round representations in binary.

So rounding is inherent, at least in the conversion between decimal (used
for input/output) and binary (used internally) bases.

I suspect your sample program uses too much precision for outputting the
result, or maybe even standard Android Java runtime does. But this has
nothing to do with the math itself.

Oh, and the space probe crashed because its controlling software used both
metric and imperial units, and someone forgot to add conversion. A good
reason for the US to go metric.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

04.09.2010 17:48 пользователь "Churky" <[email protected]> написал:

I was like to make a small correction as I posted the 2 numbers in
correctly.

My test values where 102 * 0.0254 which yields 2.5908, while i get a
value of 2.5907999999999998

Sorry for the incorrect information during the first post, as i was
still busy confirming this problem with multiple people on different
devices.


On Sep 4, 2:43 am, Indicator Veritatis <[email protected]> wrote:

> As Kostya already commented, this is rounding error. The error is well
> within the acceptable ran...

-- 
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