On Nov 23, 2006, at 7:29 PM, Russ Jones wrote:
Hi Lennox.
Your observation may be correct - but in floating point, you need
to know that 2.00000... is the same thing as 1.99999... And this
applies to all numbers. The fraction is not precise, particularly
when passing through a decimal to binary or binary to decimal
conversion.
No, I wouldn't say that in floating point 2.00000... is the same as
1.99999...
I could say that 1.999999 is the same as 2.00000 to 6 digit precision.
The issue is that a double is allowed a certain number of bits with
which to represent numbers in binary floating point. That number of
bits is not enough to represent most numbers exactly, as you say, but
it is adequate to represent any number exactly to 15-16 significant
digits of precision. This is accomplished by approximating the given
number with a floating point number which equals the given number
when rounded to the 15/16 digits.
Best,
Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>