- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for ListNum (0.35 sec)
-
test/typeparam/listimp.dir/main.go
panic(fmt.Sprintf("got %s, want %s", got, want)) } j3 := &a.ListNum[int]{nil, 1} j2 := &a.ListNum[int]{j3, 32} j1 := &a.ListNum[int]{j2, 2} if got, want := j1.ClippedLargest(), 2; got != want { panic(fmt.Sprintf("got %d, want %d", got, want)) } g3 := &a.ListNum[float64]{nil, 13.5} g2 := &a.ListNum[float64]{g3, 1.2} g1 := &a.ListNum[float64]{g2, 4.5} if got, want := g1.ClippedLargest(), 4.5; got != want {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 24 02:14:15 UTC 2022 - 1.4K bytes - Viewed (0) -
test/typeparam/listimp.dir/a.go
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64 } // ListNum is a linked _List of ordered numeric values of type T. type ListNum[T OrderedNum] struct { Next *ListNum[T] Val T } const Clip = 5 // ClippedLargest returns the largest in the list of OrderNums, but a max of 5. func (l *ListNum[T]) ClippedLargest() T { var max T for p := l; p != nil; p = p.Next {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Dec 03 17:08:51 UTC 2022 - 1.1K bytes - Viewed (0)