At 12:35 PM -0400 7/28/06, Peter K. Stys wrote:
Actually we're both right and wrong:In[55]:=RealDigits[0.036,2,100] Out[55]={{1,0,0,1,0,0,1,1,0,1,1,1,0,1,0,0,1,0,1,1,1,1,0,0,0,1,1,0,1,0,1,0,0,1,1,1,1, 1,1,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},-4} Shows that 0.036 can be represented exactly in binary, but requires 51 significant digits (if I counted correctly to the last 1). So with a 64 bit double, it probably just missed the # of digits in the mantissa to represent 0.036 exactly.
I couldn't reply in this thread in a timely manner because of a change in earthlink's SMTP server which prevented me from sending any email.
The above binary representation of .036 is incorrect. My Base Converter application shows and verifies that to 100 binary point places the correct representation is:
.000010010011011101001011110001101010011111101111100111011011001000101101000011100101011000000100001So the first part of Out[55] is correct, but the final group of all zeroes is not. I saw that someone else has proven that .036 requires an infinite number of binary point places for an exact representation .
Base Converter is a Universal Cocoa application for Mac OS X only. It's freeware and can be found at:
http://homepage.mac.com/delaneyrm/BaseConverter.htmlI wrote it to develop my Cocoa skills. If there's any demand I'll write a REALbasic version.
Bob _______________________________________________ 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>
