Is there a BigInteger class in PHP?

前端 未结 2 2096
一向
一向 2020-11-27 08:21

Is there a BigInteger class in PHP? If so, how do I access it or use it?

2条回答
  •  遥遥无期
    2020-11-27 08:43

    Hopefully helpfull links :

    • http://php.net/manual/en/ref.bc.php
    • http://php.net/manual/en/ref.gmp.php

    EDIT: Math_BigInteger

    Example from http://phpseclib.sourceforge.net/documentation/math.html :

    Implements an arbitrary precision integer arithmetic library. Uses gmp or bcmath, if available, and an internal implementation, otherwise.

    add($b);
    
        echo $c->toString(); // outputs 5
    ?>
    

提交回复
热议问题