We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 79da1be + 9176e30 commit 1741a70Copy full SHA for 1741a70
src/methods.jl
@@ -80,7 +80,7 @@ function number_methods(T, rhs1, rhs2, options=nothing)
80
81
# Fix method ambiguity error on NaNMath >= 1.0.2 and promotion of `Integer`s on NaNMath < 1.0.2
82
if f === NaNMath.pow
83
- push!(exprs, :((f::$(typeof(f)))(a::$T, b::Integer) = ($assert_like(f, Number, a); $term($(^), a, b))))
+ push!(exprs, :((f::$(typeof(f)))(a::$T, b::Integer) = a ^ b))
84
end
85
86
test/code.jl
@@ -106,13 +106,13 @@ nanmath_st.rewrites[:nanmath] = true
106
107
@test toexpr(a^-1) == :($(/)(1, a))
108
@test toexpr(a^-1, nanmath_st) == :($(/)(1, a))
109
- @test toexpr(NaNMath.pow(a, -1)) == :($(inv)(a))
110
- @test toexpr(NaNMath.pow(a, -1), nanmath_st) == :($(inv)(a))
+ @test toexpr(NaNMath.pow(a, -1)) == :($(/)(1, a))
+ @test toexpr(NaNMath.pow(a, -1), nanmath_st) == :($(/)(1, a))
111
112
@test toexpr(a^-2) == :($(/)(1, $(^)(a, 2)))
113
@test toexpr(a^-2, nanmath_st) == :($(/)(1, $(^)(a, 2)))
114
- @test toexpr(NaNMath.pow(a, -2)) == :($(^)($(inv)(a), 2))
115
- @test toexpr(NaNMath.pow(a, -2), nanmath_st) == :($(^)($(inv)(a), 2))
+ @test toexpr(NaNMath.pow(a, -2)) == :($(/)(1, $(^)(a, 2)))
+ @test toexpr(NaNMath.pow(a, -2), nanmath_st) == :($(/)(1, $(^)(a, 2)))
116
117
f = GlobalRef(NaNMath, :sin)
118
test_repr(toexpr(LiteralExpr(:(let x=1, y=2
0 commit comments