Bug #10632 Precision math: CEILING function can return the wrong answer
Submitted: 13 May 2005 19:45 Modified: 15 Jun 2005 15:08
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.6-beta-debug OS:Linux (SUSE 9.2)
Assigned to: Alexey Botchkov CPU Architecture:Any

[13 May 2005 19:45] Peter Gulutzan
Description:
The manual says:
"CEILING(X) , CEIL(X) 
Returns the smallest integer value not less than X."
But if X has more than one post-decimal digit,
and the first post-decimal digit is 0, the return
is an integer value which is less than X.

See also BUG#8430, which is now closed.

How to repeat:
mysql> select ceil(0.09);
+------------+
| ceil(0.09) |
+------------+
|          0 |
+------------+
1 row in set (0.00 sec)
[13 May 2005 19:50] MySQL Verification Team
Thank you for the bug report.
[15 Jun 2005 15:02] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26027
[15 Jun 2005 15:08] Alexey Botchkov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html