MySQL | FLOAT and DOUBLE
Start your free 7-days trial now!
MySQL's FLOAT
and DOUBLE
types are used to represent approximate numeric data values. The FLOAT
type is for single-precision (4 bytes), while DOUBLE
is for double-precision (8 bytes).
TYPE | STORAGE | ACCURACY | PERMISSIBLE VALUES |
---|---|---|---|
| 32 bits | Accurate to approx. 7 d.p | -3.402823466E+38 to -1.175494351E-38, 0, 1.175494351E-38 to 3.402823466E+38 |
| 64 bits | Accurate to approx. 14 d.p | -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, 2.2250738585072014E-308 to 1.7976931348623157E+308 |
FLOAT - Single precision
FLOAT(p)
p
represents precision in bits. MySQL only uses this value to determine whether to use FLOAT
or DOUBLE
for the resulting data type. If the provided p
is from 0 - 24 FLOAT
is used.
DOUBLE - Double precision
FLOAT(p)
p
represents precision in bits. MySQL only uses this value to determine whether to use FLOAT
or DOUBLE
for the resulting data type. If the provided p
is from 25 - 53 DOUBLE
is used.