Skip to content

Commit 9310bef

Browse files
committed
Merge remote-tracking branch 'origin/master' into multivariate_polynomials
2 parents 9cb8cab + 1400c0f commit 9310bef

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ function similarterm(p::NumericTerm, f, args, T=nothing; metadata=nothing)
957957
elseif f == (*)
958958
Mul(T, makemul(1, args...)...; metadata=metadata)
959959
elseif f == (^) && length(args) == 2
960-
Pow{T, typeof.(args)...}(args...; metadata=metadata)
960+
Pow{T}(makepow(args...)...; metadata=metadata)
961961
else
962962
Term{T}(f, args; metadata=metadata)
963963
end

test/basics.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,10 @@ end
166166
@test repr((-1)^a) == "(-1)^a"
167167
end
168168

169-
@testset "similarterm with Add" begin
169+
@testset "similarterm" begin
170170
@syms a b c
171171
@test isequal(SymbolicUtils.similarterm((b + c), +, [a, (b+c)]).dict, Dict(a=>1,b=>1,c=>1))
172+
@test isequal(SymbolicUtils.similarterm(b^2, ^, [b^2, 1//2]), b)
172173
end
173174

174175
toterm(t) = Term{symtype(t)}(operation(t), arguments(t))

0 commit comments

Comments
 (0)