#32305 [NEW]: ceil returns unexpected results
From: webmaster at ew3d dot com
Operating system: CentOS 4.0
PHP version: 4.3.9
PHP Bug Type: Math related
Bug description: ceil returns unexpected results
Description:
------------
I'm running the current RHEL rpm php 4.3.9 i386.
Reproduce code:
---------------
printf(ceil(0.05*100)/100); //Returns 0.05
printf(ceil(0.06*100)/100); //Returns 0.06
printf(ceil(0.07*100)/100); //Returns 0.08 <-- Wrong
printf(ceil(7)); //Returns 7
printf(ceil(0.08*100)/100); //Returns 0.08
printf(ceil(0.14*100)/100); //Returns 0.15 <-- Wrong
printf(ceil(0.21*100)/100); //Returns 0.21
Expected result:
----------------
0.05
0.06
0.07
7
0.08
0.14
0.21
Actual result:
--------------
0.05
0.06
0.08
7
0.08
0.15
0.21
--
Edit bug report at http://bugs.php.net/?id=32305&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32305&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32305&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32305&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32305&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32305&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32305&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32305&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32305&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32305&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32305&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32305&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32305&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32305&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32305&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32305&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32305&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32305&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32305&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32305&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32305&r=mysqlcfg
Thread (2 messages)
- webmaster at ew3d dot com