#20365 [NEW]: the modulo operator % doesn't work with negative integers!
| From: | Ernest at Beinrohr dot sk | Date: | Mon, 11 Nov 2002 15:40:40 +0000 |
| Subject: | #20365 [NEW]: the modulo operator % doesn't work with negative integers! | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-24560@lists.php.net to get a copy of this message | ||
From: Ernest@Beinrohr.sk
Operating system: linux
PHP version: 4.2.2
PHP Bug Type: Math related
Bug description: the modulo operator % doesn't work with negative integers!
PHP's modulo operator cannot work with negative numbers. The positive ones
work fine, but modulo is defined also on negatives ;-)
ex: 10%3 = 1 [php gives 1]
-4%10 = 6 [php gives NULL]
--
Edit bug report at http://bugs.php.net/?id=20365&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20365&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20365&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20365&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20365&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20365&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20365&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20365&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20365&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20365&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20365&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20365&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20365&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20365&r=isapi