Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Commit

Permalink
Fix list test
Browse files Browse the repository at this point in the history
  • Loading branch information
btracey committed Jan 18, 2017
1 parent 3ab5199 commit 933011a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mat64/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,10 @@ func equalApprox(a, b Matrix, tol float64, ignoreNaN bool) bool {
for i := 0; i < ar; i++ {
for j := 0; j < ac; j++ {
if !floats.EqualWithinAbsOrRel(a.At(i, j), b.At(i, j), tol, tol) {
if !ignoreNaN || math.IsNaN(a.At(i, j)) != math.IsNaN(b.At(i, j)) {
return false
if ignoreNaN && math.IsNaN(a.At(i, j)) && math.IsNaN(b.At(i, j)) {
continue
}
return false
}
}
}
Expand Down

0 comments on commit 933011a

Please sign in to comment.