PhP 如何划分一个大数

How do Divide a H U G E Number in PhP

我想在 PHP 中将一个大数除以 97。

我的号码:500105175408332501131480

在 Java 中我使用了 Bigint Class 但在 PHP 中我不能。 我在沙盒机上工作也很重要,所以我无法使用 Composer 等。pp.

(我正在研究 https://platform.entwicklerheld.de

是否可以在不使用像这样的 Lib 的情况下对如此巨大的数字进行除法 https://github.com/pear/Math_BigInteger/blob/trunk/demo/benchmark.php

BC Math can calculate with strings. I am guessing you want to have the remainer of the division only? Then bcmod 将是您的选择。否则选择 bcdiv.

注意:仅适用于 php 7.2+,在此函数也以 int 精度进行切割之前。