PDF (A4) - 40.5Mb
Man Pages (TGZ) - 259.5Kb
Man Pages (Zip) - 366.7Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb
TheFLOAT andDOUBLE types represent approximate numeric data values. MySQL uses four bytes for single-precision values and eight bytes for double-precision values.
ForFLOAT, the SQL standard permits an optional specification of the precision (but not the range of the exponent) in bits following the keywordFLOAT in parentheses, that is,FLOAT(. MySQL also supports this optional precision specification, but the precision value inp)FLOAT( is used only to determine storage size. A precision from 0 to 23 results in a 4-byte single-precisionp)FLOAT column. A precision from 24 to 53 results in an 8-byte double-precisionDOUBLE column.
MySQL permits a nonstandard syntax:FLOAT( orM,D)REAL( orM,D)DOUBLE PRECISION(. Here,M,D)( means than values can be stored with up toM,D)M digits in total, of whichD digits may be after the decimal point. For example, a column defined asFLOAT(7,4) is displayed as-999.9999. MySQL performs rounding when storing values, so if you insert999.00009 into aFLOAT(7,4) column, the approximate result is999.0001.
FLOAT(andM,D)DOUBLE( are nonstandard MySQL extensions; and are deprecated. You should expect support for these variants to be removed in a future version of MySQL.M,D)
Because floating-point values are approximate and not stored as exact values, attempts to treat them as exact in comparisons may lead to problems. They are also subject to platform or implementation dependencies. For more information, seeSection B.3.4.8, “Problems with Floating-Point Values”.
For maximum portability, code requiring storage of approximate numeric data values should useFLOAT orDOUBLE PRECISION with no specification of precision or number of digits.
PDF (A4) - 40.5Mb
Man Pages (TGZ) - 259.5Kb
Man Pages (Zip) - 366.7Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb