Bug #12155 Updated: modulus %

From: Date: Sat, 14 Jul 2001 00:34:11 +0000
Subject: Bug #12155 Updated: modulus %
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-60013@lists.php.net to get a copy of this message
ID: 12155 User updated by: yaragn@hotmail.com Reported By: yaragn@hotmail.com Old Status: Open Status: Closed Bug Type: Math related Operating System: linux 2.4.3 PHP Version: 4.0.5 New Comment: Integer limited to 2047000000 so there. Previous Comments: ------------------------------------------------------------------------ [2001-07-13 18:29:23] yaragn@hotmail.com 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 this bug report at http://bugs.php.net/?id=12155&edit=1

« previous php.dev (#60013) next »