Reply: PHP 4.0 Bug #8250 Updated: % calculation error
| From: | erwinba at 163 dot net | Date: | Tue, 19 Dec 2000 06:38:07 +0000 |
| Subject: | Reply: PHP 4.0 Bug #8250 Updated: % calculation error | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-41823@lists.php.net to get a copy of this message | ||
But PHP cannot declare a unsigned long, What is the GMP extension?
Previous Comments:
---------------------------------------------------------------------------
ID: 8250
Updated by: stas
Reported By: erwinba@163.net
Old-Status: Open
Status: Closed
Bug Type: Feature/Change Request
Assigned To:
Comments:
You cannot reliably do integer operations on numbers that do
not fit signed long. Use GMP extension for that.
Previous Comments:
---------------------------------------------------------------------------
[2000-12-14 04:22:00] erwinba@163.net
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.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8250
===============================================
ΪÄã¶ø½¨£¬ÎªÄã¶øÉ裬ÈÃÄã´«µÝÕæÐÄÕæÒâ
---- 163.netºØ¿¨Õ¾£¨http://ecard.163.net£©
163µç×ÓÓʾÖȫзîÏ×£¬¾«²ÊÎÞÏ޵ĵç×Ӻؿ¨Õ¾¡£
===============================================