Today when I was designing the data table, I suddenly discovered that FLOAT turned out to be very unreliable, so I suggest you change it to the DOUBLE type.
The reason is:
In the MySQL manual As mentioned in the article, all calculations in MySQL are completed using double precision. Using float (single precision) will cause errors and unexpected results.
When we query data, MySQL uses the precision of 64-bit decimal values to perform the DECIMAL operation. float(5.54) = 5.54 If there is a loss of precision, this is not equal. In this way, the data that we should be able to find will disappear inexplicably.
The above is the content of mysql advanced (10) unreliable FLOAT data type. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!