@@ -19,3 +19,25 @@ Base.promote_rule(::Type{RT}, ::Type{PT}) where {PT<:APL, RT<:RationalPoly} = pr
1919# promote_rule(::Type{RationalPoly{C, S, T}}, ::Type{Term{C, U}}) where {C, S, T, U} = RationalPoly{C, promote_type(U, S), T}
2020# promote_rule(::Type{Polynomial{C, U}}, ::Type{RationalPoly{C, S, T}}) where {C, S, T, U} = RationalPoly{C, promote_type(U, S), T}
2121# promote_rule(::Type{RationalPoly{C, S, T}}, ::Type{Polynomial{C, U}}) where {C, S, T, U} = RationalPoly{C, promote_type(U, S), T}
22+
23+ function MA. promote_operation (
24+ op:: Union{typeof(+), typeof(-)} , PT:: Type{<:APL{S}} ,
25+ :: Type{<:APL{T}} ) where {S, T}
26+
27+ U = MA. promote_operation (op, S, T)
28+ return polynomialtype (PT, U)
29+ end
30+ function MA. promote_operation (:: typeof (* ), MT:: Type{<:AbstractMonomialLike} ,
31+ :: Type{<:AbstractMonomialLike} )
32+ return monomialtype (MT)
33+ end
34+ function MA. promote_operation (:: typeof (* ), TT:: Type{<:AbstractTermLike{S}} ,
35+ :: Type{<:AbstractTermLike{T}} ) where {S, T}
36+ U = MA. promote_operation (* , S, T)
37+ return termtype (TT, U)
38+ end
39+ function MA. promote_operation (:: typeof (* ), PT:: Type{<:APL{S}} ,
40+ :: Type{<:APL{T}} ) where {S, T}
41+ U = MA. promote_operation (MA. add_mul, S, T)
42+ return polynomialtype (PT, U)
43+ end
0 commit comments