Bug #68837 [NEW]: integer bcdiv randomly add traling 0

From: Date: Thu, 15 Jan 2015 12:51:05 +0000
Subject: Bug #68837 [NEW]: integer bcdiv randomly add traling 0
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189970@lists.php.net to get a copy of this message
From: PhoneixSegovia at gmail dot com Operating system: Ubuntu PHP version: 5.5.20 Package: BC math related Bug Type: Bug Bug description:integer bcdiv randomly add traling 0 Description: ------------ When you do simple integer division with bcdiv some times the result have trailing 0 and other times is a simply integer (without .000000). For example with bcdiv('4163592965659328', 32) some times return "130112280176854" but other times return "130112280176854.0000000000". It appeared to be totally random as you refresh the page. I have version 5.5.9. I have searched in the bugs but I didn't found any similar bug. Also I know I must use the last version of php to report a bug but I can't do it (company limitation). Note to use the hard refresh in the test script so the page isn't cached. Test script: --------------- <!DOCTYPE HTML> <html> <body> <?php echo bcdiv('4163592965659328', 32); ?> </body> </html> Expected result: ---------------- 130112280176854 Actual result: -------------- 130112280176854.0000000000 -- Edit bug report at https://bugs.php.net/bug.php?id=68837&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68837&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68837&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68837&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68837&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68837&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68837&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68837&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68837&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68837&r=support Expected behavior: https://bugs.php.net/fix.php?id=68837&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68837&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68837&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68837&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68837&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68837&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68837&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68837&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68837&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68837&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68837&r=mysqlcfg

« previous php.bugs (#189970) next »