Problems with Floating-Point Comparisons
"J.T. Moore" <[email protected]> Mon, 13 Dec 2004 00:12:35 -0500
| Newsgroups | gmane.comp.db.mysql.bugs |
|---|---|
| Message-ID | <[email protected]> |
Having run across the problems with float comparisons and having read http://dev.mysql.com/doc/mysql/en/Problems_with_float.html I consider the problem with floating point comparisons to be a bug in mysql. When performing comparisons of floating point numbers, shouldn't mysql implicitly round the floating point number to the level of percision defined. For example, if a table column is defined as float(4,2), one would expect that the stored value would be automatically rounded to 2 decimal places before evaluating the comparison. The problem is trival to work around, but a nuisance and it should be fixed.