Skip to content

Commit 0f85564

Browse files
authored
Merge pull request #160 from jverzani/issue_159
close issue 159
2 parents 12d611f + 2bb0ccf commit 0f85564

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Polynomials.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ function _polyder(p::Poly{T}, order::Int=1) where {T}
564564
n = length(p)
565565
a2 = Vector{T}(undef, n-order)
566566
for i = order:n-1
567-
a2[i-order+1] = p[i] * prod((i-order+1):i)
567+
a2[i-order+1] = reduce(*, (i-order+1):i, init=p[i])
568568
end
569569

570570
return Poly(a2, p.var)

test/runtests.jl

+2
Original file line numberDiff line numberDiff line change
@@ -391,3 +391,5 @@ xx = Real[20.0, 30.0, 40.0]
391391
yy = Real[15.7696, 21.4851, 28.2463]
392392
polyfit(xx,yy,2)
393393

394+
## Issue with overflow and polyder Issue #159
395+
@test !iszero(polyder(Poly(BigInt[0, 1])^100, 100))

0 commit comments

Comments
 (0)