Bug #12155: modulus %

From: Date: Fri, 13 Jul 2001 22:29:23 +0000
Subject: Bug #12155: modulus %
Groups: php.dev 
Request: Send a blank email to php-dev+get-60009@lists.php.net to get a copy of this message
From: yaragn@hotmail.com Operating system: linux 2.4.3 PHP version: 4.0.5 PHP Bug Type: Math related Bug description: modulus % Appears to be broken on large(r) integers. Is this a limitation on the type used? (I am coding working ip2long/long2ip). $temp = 3194548456; print "correct: " . ($temp - 255*floor($temp/255)); print "php: " . $temp % 255 . "<br>"; as defined in maths, the % is equiv to MOD(n, d) = n - d*INT(n/d) where n is the number, d is the divisor. -- Edit bug report at: http://bugs.php.net/?id=12155&edit=1

« previous php.dev (#60009) next »