开发者

Why PEAR Math_BigInteger(48) => 0? (case : MATH_BIGINTEGER_MODE => default)

I used PEAR/Math/BigInteger.php

  1. PHP 5.2.5 (cli)
  2. 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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜