Description\n-----------\n\nDue to their nature, not all floating-point numbers can be stored with exact precision. Hardware architecture, the CPU or even the compiler version and optimization level may affect the precision.\n\nIf you are comparing DOUBLEs or FLOATs with numeric decimals, it is not safe to use the equality operator.\n\nSometimes, changing a floating-point number from single-precision (FLOAT) to double-precision (DOUBLE) will fix the problem.\n\nExamples\n--------\n\nCREATE TABLE fpn (id INT, f1 FLOAT, f2 DOUBLE, f3 DECIMAL (10,3));\nINSERT INTO fpn VALUES (1,2,2,2),(2,0.1,0.1,0.1);\n\nSELECT  FROM fpn WHERE f1f1 = f2*f2;\n+------+------+------+-------+\n| id   | f1   | f2   | f3    |\n+------+------+------+-------+\n|    1 |    2 |    2 | 2.000 |\n+------+------+------+-------+\n\nURL: https://mariadb.com/docs/server/reference/data-types/numeric-data-types/floating-point-accuracy