@@ -32,7 +32,8 @@ Base.rem(f::APL, g::Union{APL, AbstractVector{<:APL}}; kwargs...) = divrem(f, g;
32
32
33
33
proddiff (x, y) = x/ y - x/ y
34
34
function Base. divrem (f:: APL{T} , g:: APL{S} ; kwargs... ) where {T, S}
35
- rf = convert (polynomialtype (f, Base. promote_op (proddiff, T, S)), MA. copy_if_mutable (f))
35
+ # `promote_type(typeof(f), typeof(g))` is needed for TypedPolynomials in case they use different variables
36
+ rf = convert (polynomialtype (promote_type (typeof (f), typeof (g)), Base. promote_op (proddiff, T, S)), MA. copy_if_mutable (f))
36
37
q = zero (rf)
37
38
r = zero (rf)
38
39
lt = leadingterm (g)
@@ -60,7 +61,8 @@ function Base.divrem(f::APL{T}, g::APL{S}; kwargs...) where {T, S}
60
61
q, r
61
62
end
62
63
function Base. divrem (f:: APL{T} , g:: AbstractVector{<:APL{S}} ; kwargs... ) where {T, S}
63
- rf = convert (polynomialtype (f, Base. promote_op (proddiff, T, S)), MA. copy_if_mutable (f))
64
+ # `promote_type(typeof(f), eltype(g))` is needed for TypedPolynomials in case they use different variables
65
+ rf = convert (polynomialtype (promote_type (typeof (f), eltype (g)), Base. promote_op (proddiff, T, S)), MA. copy_if_mutable (f))
64
66
r = zero (rf)
65
67
q = similar (g, typeof (rf))
66
68
for i in eachindex (q)
0 commit comments