- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 2,750 for i$ (0.02 sec)
-
src/sort/sort_slices_benchmark_test.go
r := rand.New(rand.NewPCG(42, 0)) ints := make([]int, n) for i := 0; i < n; i++ { ints[i] = r.IntN(n) } return ints } func makeSortedInts(n int) []int { ints := make([]int, n) for i := 0; i < n; i++ { ints[i] = i } return ints } func makeReversedInts(n int) []int { ints := make([]int, n) for i := 0; i < n; i++ { ints[i] = n - i } return ints }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 08 22:59:40 UTC 2024 - 4K bytes - Viewed (0) -
src/reflect/iter_test.go
{"func", ValueOf(func(f func(int, int) bool) { for i := range 4 { f(i, i+1) } }), func(t *testing.T, s iter.Seq2[Value, Value]) { i := int64(0) for v1, v2 := range s { if v1.Int() != i { t.Fatalf("got %d, want %d", v1.Int(), i) } i++ if v2.Int() != i { t.Fatalf("got %d, want %d", v2.Int(), i) } } if i != 4 { t.Fatalf("should loop four times") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 10 14:27:54 UTC 2024 - 6.4K bytes - Viewed (0) -
test/checkbce.go
a[5] = 1 a[5] = 1 } func f1(a [256]int, i int) { var j int useInt(a[i]) // ERROR "Found IsInBounds$" j = i % 256 useInt(a[j]) // ERROR "Found IsInBounds$" j = i & 255 useInt(a[j]) j = i & 17 useInt(a[j]) if 4 <= i && i < len(a) { useInt(a[i]) useInt(a[i-1]) useInt(a[i-4]) } } func f2(a [256]int, i uint) { useInt(a[i]) // ERROR "Found IsInBounds$" j := i % 256
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:25 UTC 2023 - 3.7K bytes - Viewed (0) -
src/math/huge_test.go
func TestHugeCos(t *testing.T) { for i := 0; i < len(trigHuge); i++ { f1 := cosHuge[i] f2 := Cos(trigHuge[i]) if !close(f1, f2) { t.Errorf("Cos(%g) = %g, want %g", trigHuge[i], f2, f1) } f3 := Cos(-trigHuge[i]) if !close(f1, f3) { t.Errorf("Cos(%g) = %g, want %g", -trigHuge[i], f3, f1) } } } func TestHugeSin(t *testing.T) { for i := 0; i < len(trigHuge); i++ { f1 := sinHuge[i]
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jul 31 16:23:41 UTC 2023 - 2.9K bytes - Viewed (0) -
src/strconv/itoa.go
return append(dst, small(int(i))...) } dst, _ = formatBits(dst, i, base, false, true) return dst } // small returns the string for an i with 0 <= i < nSmalls. func small(i int) string { if i < 10 { return digits[i : i+1] } return smallsString[i*2 : i*2+2] } const nSmalls = 100 const smallsString = "00010203040506070809" + "10111213141516171819" + "20212223242526272829" +
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 04 14:21:28 UTC 2024 - 5.3K bytes - Viewed (0) -
src/cmd/compile/internal/test/math_test.go
for i := 1; i <= b.N; i++ { r = -(int64(i) - r) % int64(i) } Output = int(r) } func BenchmarkMod64SmallNegBoth(b *testing.B) { r := int64(1) for i := 1; i <= b.N; i++ { r = -(int64(i) + r) % -int64(i) } Output = int(r) } func BenchmarkMod64Unsigned(b *testing.B) { r := uint64(1) for i := 1; i <= b.N; i++ { r = (uint64(0x7fffffffffffffff) - uint64(i) - (r & 1)) % uint64(i) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 17 23:34:11 UTC 2023 - 3.4K bytes - Viewed (0) -
src/cmd/vendor/rsc.io/markdown/table.go
col := 0 delim := tableTrimOuter(delim1) i := 0 for ; ; col++ { for i < len(delim) && isTableSpace(delim[i]) { i++ } if i >= len(delim) { break } if i < len(delim) && delim[i] == ':' { i++ } if i >= len(delim) || delim[i] != '-' { return false } i++ for i < len(delim) && delim[i] == '-' { i++ } if i < len(delim) && delim[i] == ':' { i++ }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 24 13:01:26 UTC 2024 - 5.4K bytes - Viewed (0) -
src/crypto/tls/common_string.go
) var ( _CurveID_index_0 = [...]uint8{0, 9, 18, 27} ) func (i CurveID) String() string { switch { case 23 <= i && i <= 25: i -= 23 return _CurveID_name_0[_CurveID_index_0[i]:_CurveID_index_0[i+1]] case i == 29: return _CurveID_name_1 case i == 25497: return _CurveID_name_2 default: return "CurveID(" + strconv.FormatInt(int64(i), 10) + ")" } } func _() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 14:56:25 UTC 2024 - 3.4K bytes - Viewed (0) -
src/internal/runtime/atomic/atomic_andor_test.go
done := make(chan bool) for i := 0; i < 32; i++ { m := ^uint32(1 << i) go func() { for i := range a { atomic.And(&a[i], m) } done <- true }() } for i := 0; i < 32; i++ { <-done } // Check that the array has been totally cleared. for i, v := range a { if v != 0 { t.Fatalf("a[%v] not cleared: want %#x, got %#x", i, uint32(0), v) } } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sat Apr 27 20:49:32 UTC 2024 - 5.2K bytes - Viewed (0) -
test/range4.go
println("wrong count ranging over f:", j) bad = true } if i != 4 { println("wrong final i ranging over f:", i) bad = true } if bad { panic("testfunc2") } } func testfunc3() { bad := false j := 1 var i int for i = range yield4 { if i != j { println("range var", i, "want", j) bad = true } j++ if i == 2 { break } continue } if j != 3 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jan 08 16:00:53 UTC 2024 - 5.1K bytes - Viewed (0)