Re: missing 7th digit in float
Sergei Golubchik <[email protected]>
| Newsgroups | gmane.comp.db.mysql.bugs |
|---|---|
| Message-ID | <[email protected]> |
Hi! On Oct 20, [email protected] wrote: > > Hi Sergei, > > I won't say that the default of 6 is incorrect, but it's not what I > expected because all I heard of the precision of floating point numbers > till now is 7-8: > from http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-sgl.html > The 32-bit (single precision) IEEE floating-point representation ...This > means we get a bit more than 7 decimal digit precision. > C and Java use this standard definition. > All other database systems I could check (M$ SQLserver and Borland > Interbase) provide 7 significant digits for the float datatype as default > (Interbase has no option for it's configuration). > I don't know the reason for your decision, but I think a default of 7 would > be better for interoperatibility or a change from another database to > mysql. MySQL uses architecture-dependent format for float/double. Thus it also uses architecture-dependent settings for float's precision. In particular, 6 comes from float.h (in /usr/include/, or /lib/gcc-lib/i686-pc-linux-gnu/2.95.3/include/, or whatever), that defines #define FLT_DIG 6 Regards, Sergei -- __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Sergei Golubchik <[email protected]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer /_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany <___/ www.mysql.com -- MySQL Bugs Mailing List For list archives: http://lists.mysql.com/bugs To unsubscribe: http://lists.mysql.com/[email protected]