Skip to content

Commit a9074b2

Browse files
committed
Use atol as default ztol in isapprox
1 parent f8c3d07 commit a9074b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/comp.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ function grlex(x::Vector{Int}, y::Vector{Int})
135135
end
136136
end
137137

138-
function Base.isapprox(p::Polynomial{C, S}, q::Polynomial{C, T}; rtol::Real=Base.rtoldefault(S, T, 0), atol::Real=0, ztol::Real=Base.rtoldefault(S, T, 0)) where {C, S, T}
138+
function Base.isapprox(p::Polynomial{C, S}, q::Polynomial{C, T};
139+
rtol::Real=Base.rtoldefault(S, T, 0), atol::Real=0,
140+
ztol::Real=iszero(atol) ? Base.rtoldefault(S, T, 0) : atol) where {C, S, T}
139141
i = j = 1
140142
while i <= length(p.x) || j <= length(q.x)
141143
if i > length(p.x) || (j <= length(q.x) && q.x[j] > p.x[i])

0 commit comments

Comments
 (0)