[PHP-DEV] Reply: PHP 4.0 Bug #8250 Updated: % calculation error From: erwinba <email protected>
Date: 12/19/00

But PHP cannot declare a unsigned long, What is the GMP extension?

Previous Comments:
---------------------------------------------------------------------------

ID: 8250
Updated by: stas
Reported By: erwinba <email protected>
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 <email protected>
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电子邮局全新奉献,精彩无限的电子贺卡站。
===============================================

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>