Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/code.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,8 @@ function function_to_expr(op::Union{typeof(*),typeof(+)}, O, st)
end

function function_to_expr(op::typeof(^), O, st)
args = arguments(O)
if length(args) == 2 && args[2] isa Real && args[2] < 0
ex = args[1]
if args[2] == -1
return toexpr(Term(inv, Any[ex]), st)
else
args = Any[Term(inv, Any[ex]), -args[2]]
op = get(st.rewrites, :nanmath, false) ? op : NaNMath.pow
return toexpr(Term(op, args), st)
end
end
get(st.rewrites, :nanmath, false) === true || return nothing
args = arguments(O)
return toexpr(Term(NaNMath.pow, args), st)
end

Expand Down
Loading