Java Mutable BigInteger Class

前端 未结 3 1444
既然无缘
既然无缘 2021-02-02 16:27

I am doing calculations with BigIntegers that uses a loop that calls multiply() about 100 billion times, and the new object creation from the BigInteger is making it very slow.

3条回答
  •  半阙折子戏
    2021-02-02 16:37

    JScience has a class call LargeInteger, which is also immutable, but which they claim has significantly improved perfomance compared to BigInteger.

    http://jscience.org/

    APFloat's Apint might be worth checking out too. http://www.apfloat.org/apfloat_java/

提交回复
热议问题