Re: ESQL/C float data
Posted in 1994
I can't reply direct to "ray@info.motctl.gov.tw" because the mail system bounces it with: 421 Host info.motctl.gov.tw. not found for mailer ddn. 550 <ray@info.motctl.gov.tw>... Host unknown Sorry about the bandwidth. The question was about why 15.20 stored in a SMALLFLOAT comes out of the database and prints as 15.199999 under some circumstances. }From: johnl@informix.com (Jonathan Leffler) }To: ray@info.motctl.gov.tw }Subject: Re: ESQL/C float data } }If you want exact decimal numbers, use DECIMAL or MONEY and not FLOAT or }SMALLFLOAT. If you don't mind the inevitable minor inaccuracies inherent }in any use of FLOAT or SMALLFLOAT, then by all means continue to use them. } }I probably have more detailed discussions of the issues if you want them, }but this is standard computer science -- binary float numbers cannot }contain exact representations of most decimal fractions. } }Yours, }Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>