Knut Stolze je napisao/la:
si*********@gmail.com wrote:
Hi,
Inserting number 99999.99 into a FLOAT 17 16 field results in
9.99999900....5E+004 being inserted into the base.
What is confusing me is the digit 5 that appears at the end of the
number. Where does it come from and what does it mean? I have tried to
find something by searching about rounding, but so far didn't find
anything helpful.
If I insert number 99999.00, I don't get the number 5 at the end.
I don't know what a "FLOAT 17 16 field" is supposed to be, but I assume you
see quite normal rounding differences related to floating point numbers.
FLOAT field of length 17 and scale 16. Length is number of digits and
scale is number of digits to the right of the decimal point. This is
DB2 for iSeries, so those may be called differently in other versions.
Are you aware of this article?
http://docs.sun.com/source/806-3568/ncg_goldberg.html It explains a few
things that you should really know when dealing with floating point
numbers.
Thanks for the link. The article is lengthy so I've just skimmed it,
but this thing I am seeing could be the "guard digit" that is
mentioned there. Not sure.