PHP 4.0 Bug #6408: Large integer arithmetic broken
| From: | opoplawski at cqg dot com | Date: | Mon, 28 Aug 2000 23:24:50 +0000 |
| Subject: | PHP 4.0 Bug #6408: Large integer arithmetic broken | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-31021@lists.php.net to get a copy of this message | ||
From: opoplawski@cqg.com
Operating system: UnixWare 7.1.0
PHP version: 4.0.1pl2
PHP Bug Type: Misbehaving function
Bug description: Large integer arithmetic broken
The following script gives the wrong answer:
<?php
$var1 = 3232300816;
$var2 = 256;
$var3 = $var1 % $var2;
print "$var1 % $var2 = $var3";
?>
Output is:
3232300816 % 256 = 0
Correct answer is 16. This appears to be a consistent error, perhaps above the maximum for a 32-bit
signed int?
Documentation doesn't seem to describe the limits, but this is all 32-bit.