Bug #9880 ROUND(2.5) differs between 4.1.11 and 5.0.3 on Linux
Submitted: 13 Apr 2005 21:19 Modified: 14 Apr 2005 0:54
Reporter: Jan Kneschke Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3 OS:Linux (Linux)
Assigned to: Paul DuBois CPU Architecture:Any

[13 Apr 2005 21:19] Jan Kneschke
Description:
MySQL 4.1.11 rounds 2.5 via ROUND() to 2 and 3.5 to 4. This depends on the libc round() function as the manual says.

MySQL 5.0.3 always up on the same box: 3, 4.

How to repeat:
MySQL 5.0.3
> select  round(3.5), round(2.5);
+------------+------------+
| round(3.5) | round(2.5) |
+------------+------------+
| 4          | 3          |
+------------+------------+

MySQL 4.1.11
> select  round(3.5), round(2.5);
+------------+------------+
| round(3.5) | round(2.5) |
+------------+------------+
| 4          | 2          |
+------------+------------+

Suggested fix:
Update the manual accordingly that we are always rounding up now.

http://dev.mysql.com/doc/mysql/en/mathematical-functions.html
[14 Apr 2005 0:54] Paul DuBois
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).