Skip to content

Commit 3be0f76

Browse files
committed
Add function ismonic
1 parent 757c416 commit 3be0f76

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/common.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export fromroots,
1616
integrate,
1717
derivative,
1818
variable,
19-
isintegral
19+
isintegral,
20+
ismonic
2021

2122
"""
2223
fromroots(::AbstractVector{<:Number}; var=:x)
@@ -330,6 +331,13 @@ Determine whether a polynomial is an integer polynomial, i.e., having only integ
330331
"""
331332
isintegral(p::AbstractPolynomial) = is_(isinteger, p)
332333

334+
"""
335+
ismonic(p::AbstractPolynomial)
336+
337+
Determine whether a polynomial is a monic polynomial, i.e., its leading coefficient is one.
338+
"""
339+
ismonic(p::AbstractPolynomial) = isone(coeffs(p)[end])
340+
333341
"""
334342
coeffs(::AbstractPolynomial)
335343

0 commit comments

Comments
 (0)