2009/7/14 Dotan Cohen <[email protected]> > > I don't know how big your numbers are but ... > > > > The spreadsheet in question sees rounding in two places. In one sheet, > this number "317907988" was rounded to "317908000" in one row, but in > a later row was not rounded. In another sheet, the number "330476211" > was rounded to "330476000". All these fields are in format Number -> > General. > > > > It seems that Calc on a 32 bit computer stores numbers as 64-bit floating > > point values. Of these 64 bits (assuming IEEE format), 53 bits are used > to > > represent the actual digits, the remaining bits being used to store the > sign > > and exponent. This gives an accuracy of about 15 decimal digits. You can > see > > this by entering increasingly large numbers into a column formatted as > > integer (format as "number" with format code "0"). I got the following > > results: > > Entered Displayed > > 1234567898765 1234567898765 > > 12345678987654 12345678987654 > > 123456789876543 123456789876543 > > 1234567898765432 1234567898765430 > > > > So a lowish 15-digit number is OK but a 16-digit number isn't. In fact > > accuracy breaks down at some point in the 15-digit number range. > > If you want accurately to store codes (phone numbers, product codes, ID > > numbers etc.) of 15 digits or more you *must* store them as *text*. If > you > > actually want to handle (as in "do arithmetic on") *integer values* of 15 > or > > more digits then I don't think Calc will do it unless (possibly) you move > to > > a 64-bit computer - I don't know if Calc will use 128-bit floats which > would > > give you 112 bits of integer accuracy or about 33 decimal digits. > > > > The numbers in question are well below the 15-digits limit, even on > this 32-bit install (all systems that this spreadsheet has been edited > on have been 32 bit). > > > Does this help? > > > > My idea of "help" would be any hints on how to reproduce the problem > so that I could file a bug, and you have given me information on how > Calc _should_ behave, so yes it does help. Thanks! > > Have you still got the sheet with the number correct in one cell and rounded in another? If so you could have a look in the content.xml [sub-]file to see how they are being stored. To do this, open the .ods file with something like WinZip or gzip or 7-Zip and look at the content.xml file it contains with a text editor like Notepad or Wordpad. It *may* give some clue as to what is going on.
Hmmmm. Enter 317907988 in cell A1 of a new sheet. Select the cell. A little plus sign will appear at the bottom right corner of the cell. Drag this down to A14 and look at the value in A13. It should be 317908000, which is exactly the example you gave above. Is this what is happening? Perhaps someone thinks they are *copying* or *moving* the values from one cell to another by doing this????? -- Harold Fuchs London, England Please reply *only* to [email protected]
