PHP 4.0 Bug #8250: % calculation error
| From: | erwinba at 163 dot net | Date: | Thu, 14 Dec 2000 09:22:00 +0000 |
| Subject: | PHP 4.0 Bug #8250: % calculation error | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-41308@lists.php.net to get a copy of this message | ||
From: erwinba@163.net
Operating system: Linux
PHP version: 4.0.3
PHP Bug Type: Feature/Change Request
Bug description: % calculation error
Reference this program :
$aa=3123456789;
$bb = $aa % 1000000000;
echo "$aa,$bb<br>\n";
$aa=3123456789;
$cc = $aa - floor($aa/1000000000)*1000000000;
echo "$aa,$cc<br>\n";
The result like the following :
3123456789,-147483648
3123456789,123456789
Because $aa is a bigint, so $bb will return a negative,
but the $cc is a normal result.
--
Edit Bug report at: http://bugs.php.net/?id=8250&edit=1