Skip to content

Commit 7ba219f

Browse files
author
Carlos Baptista
committed
fix incorrect 'poly'
I made a mistake. The loop range should be reversed for correct output
1 parent 03d5d7a commit 7ba219f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Polynomials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ function poly{T}(r::AbstractVector{T}, var=:x)
296296
c = zeros(T, n+1)
297297
c[1] = 1
298298
for j = 1:n
299-
for i = 1:j
299+
for i = j:-1:1
300300
c[i+1] = c[i+1]-r[j]*c[i]
301301
end
302302
end

0 commit comments

Comments
 (0)