I used PEAR/Math/BigInteger.php
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 _int2bytes($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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With