MySQL Forums
Forum List  »  Quality Assurance

Re: POW returns different results on different versions of MySQL
Posted by: Bjørn Munch
Date: May 31, 2013 01:52AM

The mathematically correct answer is of course 47.05, but a floating point number like that cannot be represented exactly in binary, and so the conversion back to decimal may add rounding errors. This is not related to POW in particular. And it's impossible to guarantee consistent results across versions.

If you want to remove the "noise", you can use ROUND() to round off to a certain number of decimal places.

http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html#function_round

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: POW returns different results on different versions of MySQL
1510
May 31, 2013 01:52AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.