From: matt at mx-dev dot net Operating system: Windows PHP version: 5.2.10 PHP Bug Type: Math related Bug description: number_format and decimal numbers
Description: ------------ I've encountered a bug using the number_format function with a high decimal value. Actually, an approximative number appear randomly if the decimal number is greater than 30. I think that the bug can be reproduced being a little bit sticky. I succeeded to reproduce this bug with the following code : number_format(25, 49, ',', ' '); Reproduce code: --------------- echo number_format(15, 50, ',', ' '); Expected result: ---------------- 15,00000000000000000000000000000000000000000000000000 Actual result: -------------- 14,99999999999999822364316059974953532218933105468750 -- Edit bug report at http://bugs.php.net/?id=49377&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49377&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49377&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49377&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49377&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49377&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49377&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49377&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49377&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49377&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49377&r=support Expected behavior: http://bugs.php.net/fix.php?id=49377&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49377&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49377&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49377&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49377&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49377&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49377&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49377&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49377&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49377&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49377&r=mysqlcfg