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

Error on large matrix powers #1082

Open
mikmoore opened this issue Jul 29, 2024 · 0 comments · May be fixed by JuliaLang/julia#55431
Open

Error on large matrix powers #1082

mikmoore opened this issue Jul 29, 2024 · 0 comments · May be fixed by JuliaLang/julia#55431

Comments

@mikmoore
Copy link
Contributor

mikmoore commented Jul 29, 2024

julia> VERSION
v"1.10.3"

julia> [1 1e-10; 0 1] ^ 1e20
ERROR: InexactError: Int64(1.0e20)

The issue is that there are multiple places where our exponentiation routines attempt to convert (or round, in some places) the exponent to an Int without first checking that such a conversion is possible. For example, in ^, we call LinearAlgebra.integerpow on isinteger powers (including all large float powers) which attempts Integer(p). In LinearAlgebra.schurpow we attempt floor(Integer, p) which fails for the same reasons. There may be additional sites with the unchecked assumption that one can convert to Int, but I noticed those two.

@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
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