From: David dot Rolli at bl dot ch Operating system: Windows XP Pro, SP2 PHP version: 5.2.6 PHP Bug Type: Unknown/Other Function Bug description: Floating number output problem
Description: ------------ I want to outpu my floating number with 13 digits but not in scientific notation - this just doesn't work with certain numbers (see code). Reproduce code: --------------- <?php ini_set("precision", 14); $a = 123456789012; $b = 123456789012.0; $c = 12345678901203; $d = 1234567890123.0; $e = 1225099800; $f = 1225099800000; $h = 1225099800001; echo('$a: ' . $a. "<BR>"); // -> 123456789012 echo('$b: ' . $b. "<BR>"); // -> 123456789012 echo('$c: ' . $c. "<BR>"); // -> 1234567890123 echo('$d: ' . $d. "<BR>"); // -> 1234567890123 echo('$e: ' . $e. "<BR>"); // -> 1225099800 echo('$f: ' . $f. "<BR>"); // -> 1.2250998E+12 !!! echo('$h: ' . $h. "<BR>"); // -> 1225099800001 !!! ?> Expected result: ---------------- 123456789012 123456789012 1234567890123 1234567890123 1225099800 1225099800000 1225099800001 Actual result: -------------- 123456789012 123456789012 1234567890123 1234567890123 1225099800 12250998E+12 1225099800001 -- Edit bug report at http://bugs.php.net/?id=46400&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46400&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46400&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46400&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46400&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46400&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46400&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46400&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46400&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46400&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46400&r=support Expected behavior: http://bugs.php.net/fix.php?id=46400&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46400&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46400&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46400&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46400&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46400&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46400&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46400&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46400&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46400&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46400&r=mysqlcfg