Why PEAR Math_BigInteger(48) => 0? (case : MATH_BIGINTEGER_MODE => default)
I used PEAR/Math/BigInteger.php
- PHP 5.2.5 (cli)
- ubuntu
but
$a = new Math_BigInteger(48);
echo $a -> toString()// '0'
Why? is it a bug?
it is specific of MATH_BIGINTEGER_MODE => default
3528 function _int2b开发者_如何学Cytes($x)
pack('N', 48) => 0
we need
if('48'===(string)$x){$this->value=array('48');return;}
It works for me on a i686 system:
$ php -r 'require_once "Math/BigInteger.php"; $a = new Math_BigInteger(48); echo $a -> toString();'
48
精彩评论