PHP 中有 BigInteger 类吗?如果是,我该如何访问或使用它?
最佳答案
希望有帮助的链接:
编辑:Math_BigInteger
示例来自 http://phpseclib.sourceforge.net/documentation/math.html :
实现了一个任意精度的整数算术库。使用 gmp 或 bcmath(如果可用),否则使用内部实现。
<?php
include('Math/BigInteger.php');
$a = new Math_BigInteger(2);
$b = new Math_BigInteger(3);
$c = $a->add($b);
echo $c->toString(); // outputs 5
?>
关于php - PHP 中有 BigInteger 类吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4427020/