Skip to content

Commit 8adca3b

Browse files
LilithHafnerLilith Hafner
andauthored
require one based indexing in evalpoly (#46552)
Co-authored-by: Lilith Hafner <[email protected]>
1 parent 99d8c7b commit 8adca3b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

base/math.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ end
190190
evalpoly(x, p::AbstractVector) = _evalpoly(x, p)
191191

192192
function _evalpoly(x, p)
193+
Base.require_one_based_indexing(p)
193194
N = length(p)
194195
ex = p[end]
195196
for i in N-1:-1:1
@@ -229,6 +230,7 @@ evalpoly(z::Complex, p::Tuple{<:Any}) = p[1]
229230
evalpoly(z::Complex, p::AbstractVector) = _evalpoly(z, p)
230231

231232
function _evalpoly(z::Complex, p)
233+
Base.require_one_based_indexing(p)
232234
length(p) == 1 && return p[1]
233235
N = length(p)
234236
a = p[end]

0 commit comments

Comments
 (0)