You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It shouldn't throw because there is generally no issue raising a Float to a negative power.
julia> x = Float32(1.1)
1.1f0
julia> y = typemin(Int64)
-9223372036854775808
julia> x ^ y
ERROR: DomainError with -9223372036854775808:
Cannot raise an integer x to a negative power -9223372036854775808.
Convert input to float.
Stacktrace:
[1] throw_domerr_powbysq(::Float64, p::Int64)
@ Base ./intfuncs.jl:262
[2] power_by_squaring(x_::Float64, p::Int64)
@ Base ./intfuncs.jl:286
[3] ^(x::Float32, n::Int64)
@ Base.Math ./math.jl:1280
[4] top-level scope
@ REPL[66]:1
julia> x ^ (y+1)
0.0f0
At some point there's a -exponent but -typemin(Int) == typemin(Int).
I've also opened #57463 but this goes through a different path (and anyway produce an incorrect result rather than an exception).
The text was updated successfully, but these errors were encountered:
It shouldn't throw because there is generally no issue raising a Float to a negative power.
At some point there's a
-exponent
but-typemin(Int) == typemin(Int)
.I've also opened #57463 but this goes through a different path (and anyway produce an incorrect result rather than an exception).
The text was updated successfully, but these errors were encountered: