+ 1
Difference float and double
As the title, I want to know the difference to set float or double to a column in a table. Thank you
3 Antworten
+ 4
double is bigger normally
ok i found this there are more differences
https://dev.mysql.com/doc/refman/5.5/en/floating-point-types.html
https://stackoverflow.com/questions/2160810/mysql-whats-the-difference-between-float-and-double?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
+ 2
I understand thx stefano. Float has 2 decimals, but it can be stored without zero
+ 1
We have a table like this :
+-------+-------------+
| Field | Type |
+-------+-------------+
| fla | float |
| flb | float |
| dba | double(10,2)|
| dbb | double(10,2)|
+-------+-------------+
For first difference, we try to insert a record with '1.2' to each field :
INSERT INTO `test` values (1.2,1.2,1.2,1.2);
The table showing like this :
SELECT * FROM `test`;
+------+------+------+------+
| fla | flb | dba | dbb |
+------+------+------+------+
| 1.2 | 1.2 | 1.20 | 1.20 |
+------+------+------+------+