Re: DBLOAD changes numbers!
Posted in 1998
Mjgator wrote: > > Am loading rows into OWS on NT. Have a field defined as float. Load in > delimited rows with a number such as .03. It loads as .02999999999. Why in > the WORLD would it do this? Makes my calculations come out absurd and my > tables in screens have to be much wider. I really only need precision of 3 or > so. Thoughts? Type float is an IEEE 64 bit floating point binary datatype. I do not believe that 0.03 is exactly representable in this format. You could change the column type to DECIMAL(16,3) for fixed point or DECIMAL(16) for floating point to get precision at least as good as FLOAT but with a decimal representation that can exactly store such values. It takes a little more storage and is not significantly slower than FLOAT. Informix can convert DECIMAL to any other reasonable type on SELECTion and provides library functions to deal with them directly in "C" and 4GL. Art S. Kagel