Skip to content

Commit 8ac5823

Browse files
committed
Merge pull request #4 from jverzani/patch-1
add abs() to check on coefficients for degree
2 parents e453943 + 9590ab8 commit 8ac5823

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Polynomials.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ end
186186

187187
function degree{T}(p::Poly{T})
188188
for i = length(p):-1:0
189-
if p[i] > 2*eps(T)
189+
if abs(p[i]) > 2*eps(T)
190190
return i
191191
end
192192
end
@@ -344,4 +344,4 @@ function gcd{T<:FloatingPoint, S<:FloatingPoint}(a::Poly{T}, b::Poly{S})
344344
return gcd(b, r)
345345
end
346346
end
347-
end # module Poly
347+
end # module Poly

0 commit comments

Comments
 (0)