Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException when calling divideAndRemainder for JVM #305

Open
hakanai opened this issue Aug 20, 2024 · 0 comments · May be fixed by #306
Open

ClassCastException when calling divideAndRemainder for JVM #305

hakanai opened this issue Aug 20, 2024 · 0 comments · May be fixed by #306

Comments

@hakanai
Copy link

hakanai commented Aug 20, 2024

Test program:

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)
@hakanai hakanai linked a pull request Aug 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant