-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
the error message for ^
calls all unknown types "integer"
#55960
Labels
Comments
nsajko
added
maths
Mathematical functions
error messages
Better, more actionable error messages
labels
Oct 1, 2024
The bigger issue is that this should probably just work. |
Made a separate issue about that: #55961 |
Here's a standalone example for this issue, independent of julia> struct S <: Real end
julia> Base.:(*)(::S, ::S) = S()
julia> Base.isone(::S) = false
julia> Base.:(-)(::S) = S()
julia> e = -1; S() ^ e
ERROR: DomainError with -1:
Cannot raise an integer x to a negative power -1.
Convert input to float.
Stacktrace:
[1] throw_domerr_powbysq(::S, p::Int64)
@ Base ./intfuncs.jl:302
[2] power_by_squaring(x_::S, p::Int64; mul::typeof(*))
@ Base ./intfuncs.jl:327
[3] power_by_squaring
@ ./intfuncs.jl:316 [inlined]
[4] ^(x::S, p::Int64)
@ Base ./intfuncs.jl:352
[5] top-level scope
@ REPL[5]:1
julia> versioninfo()
Julia Version 1.12.0-DEV.1282
Commit dd310849adb (2024-10-01 18:56 UTC)
Build Info:
Official https://julialang.org release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × AMD Ryzen 3 5300U with Radeon Graphics
WORD_SIZE: 64
LLVM: libLLVM-18.1.7 (ORCJIT, znver2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
NB: there's nothing special about
π
here, all unknown (not-floating-point?) types seem to be regarded as integer by the error message.The text was updated successfully, but these errors were encountered: