Skip to content

Commit a648f4a

Browse files
mcognettaandreasnoack
authored andcommitted
Changed the test for symmetry of a Number. (#18529)
* Changed the test for symmetry of a Number. * added tests for issymmetric with NaN16, NaN32, and NaN as arguments
1 parent 45bc17d commit a648f4a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

base/linalg/generic.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ function issymmetric(A::AbstractMatrix)
712712
return true
713713
end
714714

715-
issymmetric(x::Number) = true
715+
issymmetric(x::Number) = x == x
716716

717717
"""
718718
ishermitian(A) -> Bool

test/linalg/generic.jl

+4
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ for elty in [Float32,Float64,Complex64,Complex128]
223223
@test det(a) == a
224224
end
225225

226+
@test !issymmetric(NaN16)
227+
@test !issymmetric(NaN32)
228+
@test !issymmetric(NaN)
229+
226230
@test rank([1.0 0.0; 0.0 0.9],0.95) == 1
227231
@test qr(big([0 1; 0 0]))[2] == [0 1; 0 0]
228232

0 commit comments

Comments
 (0)