ID: 48939 Updated by: ka...@php.net Reported By: louis at frenzoo dot com -Status: Open +Status: Feedback Bug Type: Math related Operating System: Linux PHP Version: 5.2.10 New Comment:
Please try with PHP 5.3.0 where the rounding was revised per this RFC: http://wiki.php.net/rfc/rounding Previous Comments: ------------------------------------------------------------------------ [2009-07-16 05:11:52] louis at frenzoo dot com Description: ------------ ceil() does not give an correct expected result. I have read some bug reports before. I understand that there is floating point error, but it happens in just a simple math calculation, which is unacceptable in the below case. It created inaccurate result on simple math, it will also create chaos in more complicated ones. Reproduce code: --------------- $n = 100.0*1.1; print $n.'='.ceil($n); Expected result: ---------------- 110 = 110 Actual result: -------------- 110 = 111 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48939&edit=1