Skip to content

Commit 487b510

Browse files
committed
Fix a bug in pow!
1 parent ca74be7 commit 487b510

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/power.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,17 +355,19 @@ end
355355
rr = r*(kprime-i) - i
356356
# @inbounds c[k] += rr * c[i+lnull] * a[l0+kprime-i]
357357
@inbounds for j in eachindex(a[l0])
358-
mul_scalar!(aux[k], r * kprime, c[i+lnull], a[l0+kprime-i], j)
358+
mul_scalar!(aux[k], rr, c[i+lnull], a[l0+kprime-i], j)
359359
add!(c[k], c[k], aux[k], j)
360360
end
361361
end
362362
# @inbounds c[k] = c[k] / (kprime * a[l0])
363+
aux2 = zero(c[k])
363364
for j in eachindex(a[l0])
364365
zero!(aux[k], j)
365366
mul!(aux[k], kprime, a[l0], j)
367+
identity!(aux2, c[k], j)
366368
end
367369
for j in eachindex(a[l0])
368-
div!(c[k], c[k], aux[k], j)
370+
div!(c[k], aux2, aux[k], j)
369371
end
370372
return nothing
371373
end
@@ -552,7 +554,7 @@ end
552554
end
553555

554556
@inline function sqr!(c::Taylor1{Taylor1{T}}, a::Taylor1{Taylor1{T}}, k::Int) where
555-
{T<:AbstractSeries}
557+
{T<:NumberNotSeriesN}
556558
if k == 0
557559
sqr_orderzero!(c, a)
558560
return nothing

0 commit comments

Comments
 (0)