BigInteger bigger than the Long and Int?



我正在做一个使用非常大数字的程序,即使是最慢一点点,它也会有太多的工作。我的问题是:big_integer是否比正常的 int 和 long 慢?

    long number = 12;
    BigInteger number2 = 12;
public void add()
{
    number += 1;
}
public void add2()
{
    number2 += 1;
}

现在哪一个更快?

是的,类型BigInteger比int或long慢。

但是对于具有真正大数字的整数计算,需要一个 BigInteger。

相关内容

最新更新