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

From: Date: Wed, 27 Jul 2016 05:13:04 +0000
Subject: Bug #68837 [Opn]: integer bcdiv randomly add traling 0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202631@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68837&edit=1 ID: 68837 Updated by: pollita@php.net Reported by: PhoneixSegovia at gmail dot com Summary: integer bcdiv randomly add traling 0 Status: Open Type: Bug Package: BC math related Operating System: Ubuntu PHP Version: 5.5.20 Block user comment: N Private report: N New Comment: Is there *anywhere* in your code/config/webserver where you set bcmath.scale INI entry? The extra zeros can result from a non-zero bcmath.scale, though the question then is "Why is scale zero sometimes, then non-zero other times?" The problem *could* be a threading issue, so I'd ask if you're using PHP in a threaded environment. Previous Comments: ------------------------------------------------------------------------ [2015-01-15 12:51:05] PhoneixSegovia at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=68837&edit=1

« previous php.bugs (#202631) next »