import org.gciatto.kt.math.BigInteger
fun main() {
BigInteger.of(5).divideAndRemainder(2)
}
Result:
Exception in thread "main" java.lang.ClassCastException: class org.gciatto.kt.math.JavaBigIntegerAdapter cannot be cast to class java.math.BigInteger (org.gciatto.kt.math.JavaBigIntegerAdapter is in unnamed module of loader 'app'; java.math.BigInteger is in module java.base of loader 'bootstrap')
at org.gciatto.kt.math.JavaBigIntegerAdapter.divideAndRemainder(JavaBigIntegerAdapter.kt:186)
at org.gciatto.kt.math.BigInteger$DefaultImpls.divideAndRemainder(BigInteger.kt:157)
at org.gciatto.kt.math.JavaBigIntegerAdapter.divideAndRemainder(JavaBigIntegerAdapter.kt:5)
at BigIntegerTestKt.main(BigIntegerTest.kt:4)
at BigIntegerTestKt.main(BigIntegerTest.kt)
Test program:
Result: