#48939 [Opn->Fbk]: ceil error

From: Date: Thu, 16 Jul 2009 06:36:47 +0000
Subject: #48939 [Opn->Fbk]: ceil error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-139792@lists.php.net to get a copy of this message
ID: 48939 Updated by: kalle@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

« previous php.bugs (#139792) next »