julia floating point compare for zero

Viewed 1764
julia> r
3×3 Array{Float64,2}:
 -1.77951  -0.79521   -2.57472
  0.0       0.630793   0.630793
  0.0       0.0       -1.66533e-16

julia> sort(abs(diag(r)))[1]
1.6653345369377348e-16

julia> isequal(floor(sort(abs(diag(r)))[1]),0)
true

But this is not right

julia> isequal(sort(abs(diag(r)))[1],convert(AbstractFloat,0.0))
false

Is there a function in Julia to check for floating point equivalent to zero?

1 Answers
Related