Skip to content

Commit d1a5b6a

Browse files
committed
add missing argument check for roots maxsize
1 parent 8f4c8f4 commit d1a5b6a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/roots.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ to `5eps` where `eps` is the precision of `c`.
8787
"""
8888
function roots(c::ChebPoly{1,<:Real}; tol::Real=5*epsvals(c.coefs), maxsize::Integer=50)
8989
tol > 0 || throw(ArgumentError("tolerance $tol for truncating coefficients must be > 0"))
90+
maxsize > 0 || throw(ArgumentError("maxsize $maxsize must be > 0"))
9091
abstol = sum(abs, c.coefs) * tol # absolute tolerance = L1 norm * tol
9192
n = something(findlast(c -> abs(c) abstol, c.coefs), 1)
9293
if n <= maxsize

0 commit comments

Comments
 (0)