Skip to content

Commit 9fab19c

Browse files
committed
type stability
1 parent 36e9840 commit 9fab19c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/svd.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ end
133133

134134
# count positive singular values S ≥ given tolerances, S assumed sorted
135135
function _count_svdvals(S, atol::Real, rtol::Real)
136-
tol = isempty(S) ? atol : max(rtol*S[1], atol)
136+
tol = max(rtol * (isempty(S) ? zero(eltype(S)) : S[1]), atol)
137137
return iszero(S[1]) ? 0 : searchsortedlast(S, tol, rev=true)
138138
end
139139

0 commit comments

Comments
 (0)