Bug #11184 Round() wrong result
Submitted: 8 Jun 2005 19:54 Modified: 8 Jun 2005 20:17
Reporter: Michal Vrchota Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: User-defined functions ( UDF ) Severity:S3 (Non-critical)
Version:4.1.12 OS:Any (all)
Assigned to:

[8 Jun 2005 19:54] Michal Vrchota
Description:
Function round() does not round corectly when the number after point is equal to  5
for example
select round(2.5); returns 2
in your documentation it returns 3

How to repeat:
select round(2.5);

Suggested fix:
3 will be better :)
[8 Jun 2005 20:17] Miguel Solorzano
Please read:

http://dev.mysql.com/doc/mysql/en/problems-with-float.html

D:\dbs\4112\bin>mysql --defaults-file=d:\d:\dbs\4112\my.ini -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.6-beta-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select round(2.5);
+------------+
| round(2.5) |
+------------+
| 3          |
+------------+
1 row in set (0.05 sec)

mysql>