We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
isapprox(::AbstractArray, ::AbstractArray)
rtol = 0
1 parent 7116a8b commit 755775cCopy full SHA for 755775c
stdlib/LinearAlgebra/src/generic.jl
@@ -1772,7 +1772,7 @@ function isapprox(x::AbstractArray, y::AbstractArray;
1772
nans::Bool=false, norm::Function=norm)
1773
d = norm(x - y)
1774
if isfinite(d)
1775
- return d <= max(atol, rtol*max(norm(x), norm(y)))
+ return iszero(rtol) ? d <= atol : d <= max(atol, rtol*max(norm(x), norm(y)))
1776
else
1777
# Fall back to a component-wise approximate comparison
1778
# (mapreduce instead of all for greater generality [#44893])
0 commit comments