Home > Mobile >  What variable type can I use to hold huge numbers in kotlin?
What variable type can I use to hold huge numbers in kotlin?

Time:11-09

Is there a class similar to BigInteger for Java in Kotlin to hold very large numbers? Eg: 100 Digits

CodePudding user response:

There is currently no such class in the official Kotlin standard library other than Java's BigInteger. You might be able to use third-party libraries such as kotlin-multiplatform-bignum or kt-math, as long as you're ok with their licence conditions and be aware that both of them may change in future, and that neither of them is likely to be as fast as Java's BigInteger.

  • Related