@@ -72,13 +72,19 @@ function promote_rule(::Type{TaylorScalar{T, N}},
72
72
:: Type{S} ) where {T, S, N}
73
73
TaylorScalar{promote_type (T, S), N}
74
74
end
75
+ function promote_rule (:: Type{TaylorScalar{T1, N}} , :: Type{TaylorScalar{T2,N}} ) where {T1, T2, N}
76
+ TaylorScalar{promote_type (T1,T2), N}
77
+ end
75
78
76
79
# Number-like convention (I patched them after removing <: Number)
77
80
78
81
convert (:: Type{TaylorScalar{T, N}} , x:: TaylorScalar{T, N} ) where {T, N} = x
79
82
function convert (:: Type{TaylorScalar{T, N}} , x:: S ) where {T, S, N}
80
83
TaylorScalar {T, N} (convert (T, x))
81
84
end
85
+ function convert (:: Type{TaylorScalar{T1,N}} ,x:: TaylorScalar{T2,N} ) where {T1,T2,N}
86
+ TaylorScalar {T1,N} (convert .(T1,value (x)))
87
+ end
82
88
@inline + (a:: Number , b:: TaylorScalar ) = TaylorScalar ((a + value (b)[1 ]), value (b)[2 : end ]. .. )
83
89
@inline - (a:: Number , b:: TaylorScalar ) = TaylorScalar ((a - value (b)[1 ]), .- value (b)[2 : end ]. .. )
84
90
@inline * (a:: Number , b:: TaylorScalar ) = TaylorScalar ((a .* value (b)). .. )
0 commit comments