- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for IsNan (0.35 sec)
-
src/cmp/cmp.go
func Less[T Ordered](x, y T) bool { return (isNaN(x) && !isNaN(y)) || x < y } // Compare returns // // -1 if x is less than y, // 0 if x equals y, // +1 if x is greater than y. // // For floating-point types, a NaN is considered less than any non-NaN, // a NaN is considered equal to a NaN, and -0.0 is equal to 0.0. func Compare[T Ordered](x, y T) int { xNaN := isNaN(x) yNaN := isNaN(y) if xNaN { if yNaN { return 0
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 19 16:31:02 UTC 2024 - 2K bytes - Viewed (0) -
test/typeparam/graph.go
func _SliceEqual[Elem comparable](s1, s2 []Elem) bool { if len(s1) != len(s2) { return false } for i, v1 := range s1 { v2 := s2[i] if v1 != v2 { isNaN := func(f Elem) bool { return f != f } if !isNaN(v1) || !isNaN(v2) { return false } } } return true } // A Graph is a collection of nodes. A node may have an arbitrary number
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 26 19:58:28 UTC 2024 - 5.7K bytes - Viewed (0) -
src/slices/sort_test.go
for i := 0; i < len(fs); i++ { testfs := Clone(fs) testfs[i] = math.NaN() fmin := Min(testfs) if !math.IsNaN(fmin) { t.Errorf("got min %v, want NaN", fmin) } fmax := Max(testfs) if !math.IsNaN(fmax) { t.Errorf("got max %v, want NaN", fmax) } } } func TestMinMaxPanics(t *testing.T) { intCmp := func(a, b int) int { return a - b }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 09 19:20:55 UTC 2024 - 9.5K bytes - Viewed (0)