Skip to content

Commit

Permalink
Fix isapproxzero for non-Real
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Sep 19, 2017
1 parent c8e0e34 commit 24beb92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/comparison.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ end
(==)(α, q::RationalPoly) = α*q.den == q.num
(==)(q::RationalPoly, α) = α == q

function isapproxzero(α; ztol::Real=Base.rtoldefault(α, α))
# α could be a JuMP affine expression
isapproxzero(α; ztol::Real=0.) = false
function isapproxzero::Number; ztol::Real=Base.rtoldefault(α, α))
abs(α) <= ztol
end

Expand Down

0 comments on commit 24beb92

Please sign in to comment.