Skip to content

Commit

Permalink
Merge pull request #423 from JuliaSymbolics/s/neg-pow
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi authored Jan 18, 2022
2 parents fe731b5 + 8b5aed2 commit f588c99
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/polyform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,14 @@ add_divs(x, y::Div) = (x * y.den + y.num) / y.den
add_divs(x, y) = x + y

function frac_similarterm(x, f, args; kw...)
if f in (*, /, \, +, -, ^)
if f in (*, /, \, +, -)
f(args...)
elseif f == (^)
if args[2] isa Integer && args[2] < 0
1/((args[1])^(-args[2]))
else
args[1]^args[2]
end
else
similarterm(x, f, args; kw...)
end
Expand Down

0 comments on commit f588c99

Please sign in to comment.