Skip to content

ObserverOfTime/kbigint

Repository files navigation

KBigInt

Kotlin Multiplatform BigInteger library.

Platforms

Platform Implementation
JVM BigInteger
Android BigInteger
JS BigInt*
Native LibTomMath
WASM Not implemented

* Kotlin/JS does not fully support BigInt (KT-48980).

Motivation

Kotlin does not support BigInteger and BigDecimal types in multiplatform projects (KT-20912).
However, I was not interested in BigDecimal so this library only implements BigInteger.
Serialization is implemented in a separate module so the main library can be used on its own.

Alternatives

  • Fully custom implementation.
  • Internal library.
  • No serialization.
  • Custom Native implementation.
  • Internal library.
  • No serialization.
  • Depends on Apache Commons Math in JVM.
  • Only Linux is supported in Native (using gmp).
  • No longer updated.
  • No serialization.
  • Stub JS implementation.
  • No Native implementation.

License

Apache License 2.0