We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
is_
as_
Base.isreal
Base.real
1 parent 930b116 commit 410ccb9Copy full SHA for 410ccb9
src/abstract.jl
@@ -17,6 +17,13 @@ abstract type AbstractPolynomial{T} end
17
# works for most cases
18
⟒(P::Type{<:AbstractPolynomial}) = constructorof(P)
19
20
+# See discussions in https://github.com/JuliaMath/Polynomials.jl/issues/258
21
+is_(fn, p::AbstractPolynomial) = all(fn, coeffs(p))
22
+as_(fn, p::P) where {P<:AbstractPolynomial} = ⟒(P)(fn.(coeffs(p)), p.var)
23
+
24
+Base.isreal(p::AbstractPolynomial) = is_(isreal, p)
25
+Base.real(p::P) where {P<:AbstractPolynomial} = as_(real, p)
26
27
"""
28
Polynomials.@register(name)
29
0 commit comments