I'm learning MySQL and having problem with float's range and precision.
From the mannual:
For FLOAT, the SQL standard permits an optional specification of the precision (but not the range of the exponent) in bits following the keyword FLOAT in parentheses. MySQL also supports this optional precision specification, but the precision value is used only to determine storage size. A precision from 0 to 23 results in a 4-byte single-precision FLOAT column. A precision from 24 to 53 results in an 8-byte double-precision DOUBLE column.
I created a table using this command
create table test (f_a float(23));
I'm having 4 confusions:
- what's the meaning of
but not the range of the exponentin the mannual? - I can execute
insert into test values (1e38);without problems. Even if I type38digits it still works. But39digits or1e39will fail. So what's the meaning of this38? - How can I inspect the type conversion of
f_a? When I executedesc test;the type off_ais stillfloateven after I inserted a38digits number into that column. - So, what's the difference between range and precision on earth?