Skip to content

Commit 24beb92

Browse files
committed
Fix isapproxzero for non-Real
1 parent c8e0e34 commit 24beb92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/comparison.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ end
9898
(==)(α, q::RationalPoly) = α*q.den == q.num
9999
(==)(q::RationalPoly, α) = α == q
100100

101-
function isapproxzero(α; ztol::Real=Base.rtoldefault(α, α))
101+
# α could be a JuMP affine expression
102+
isapproxzero(α; ztol::Real=0.) = false
103+
function isapproxzero::Number; ztol::Real=Base.rtoldefault(α, α))
102104
abs(α) <= ztol
103105
end
104106

0 commit comments

Comments
 (0)