Bug #56801 | Rounding error when insert decimal value | ||
---|---|---|---|
Submitted: | 15 Sep 2010 17:29 | Modified: | 15 Sep 2010 18:49 |
Reporter: | Filipe Martins | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.1.38-community and probably ohters | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[15 Sep 2010 17:29]
Filipe Martins
[15 Sep 2010 17:54]
Davi Arnaut
The rounding behavior for floating-point values is platform dependent. See example 3 in http://dev.mysql.com/doc/refman/5.1/en/precision-math-examples.html For "round half up", use a DECIMAL column instead.
[15 Sep 2010 18:47]
Filipe Martins
Ok, I didn't knew that. It's documented, so it is acceptable. But is this wise? What's to gain in adding this uncertainty? MySQL runs on a wide range of systems so I don't see how this kind of fuzziness helps. Is there a good reason for this? Please share...
[15 Sep 2010 18:49]
Sveta Smirnova
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug. Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/ Thank you for your interest in MySQL. We can not explain why MySQL works in particular way here too.