Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 5,349 for fmtE (0.04 sec)

  1. src/net/example_test.go

    	ipv4Public := net.ParseIP("8.8.8.8")
    	ipv4Broadcast := net.ParseIP("255.255.255.255")
    
    	fmt.Println(ipv6Global.IsGlobalUnicast())
    	fmt.Println(ipv6UniqLocal.IsGlobalUnicast())
    	fmt.Println(ipv6Multi.IsGlobalUnicast())
    
    	fmt.Println(ipv4Private.IsGlobalUnicast())
    	fmt.Println(ipv4Public.IsGlobalUnicast())
    	fmt.Println(ipv4Broadcast.IsGlobalUnicast())
    
    	// Output:
    	// true
    	// true
    	// false
    	// true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 13 16:36:59 UTC 2021
    - 8.5K bytes
    - Viewed (0)
  2. src/strconv/example_test.go

    	b16 = strconv.AppendUint(b16, 42, 16)
    	fmt.Println(string(b16))
    
    	// Output:
    	// uint (base 10):42
    	// uint (base 16):2a
    }
    
    func ExampleAtoi() {
    	v := "10"
    	if s, err := strconv.Atoi(v); err == nil {
    		fmt.Printf("%T, %v", s, s)
    	}
    
    	// Output:
    	// int, 10
    }
    
    func ExampleCanBackquote() {
    	fmt.Println(strconv.CanBackquote("Fran & Freddie's Diner ☺"))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 22:57:37 UTC 2023
    - 8.9K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/test/testdata/gen/constFoldGen.go

    					fmt.Fprintf(w, "\ty = %d\n", d)
    					fmt.Fprintf(w, "\tr = x %s y\n", o.symbol)
    					want := ansS(c, d, s.name, o.symbol)
    					fmt.Fprintf(w, "\tif r != %s {\n", want)
    					fmt.Fprintf(w, "\t\tt.Errorf(\"%d %%s %d = %%d, want %s\", %q, r)\n", c, d, want, o.symbol)
    					fmt.Fprintf(w, "\t}\n")
    				}
    			}
    			fmt.Fprintf(w, "}\n")
    		}
    	}
    
    	// Special signed/unsigned cases for shifts
    	for _, ls := range szs {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 8.4K bytes
    - Viewed (0)
  4. src/math/example_test.go

    	fmt.Printf("%.2f\n", math.Dim(4, -2))
    	fmt.Printf("%.2f\n", math.Dim(-4, 2))
    	// Output:
    	// 6.00
    	// 0.00
    }
    
    func ExampleExp() {
    	fmt.Printf("%.2f\n", math.Exp(1))
    	fmt.Printf("%.2f\n", math.Exp(2))
    	fmt.Printf("%.2f\n", math.Exp(-1))
    	// Output:
    	// 2.72
    	// 7.39
    	// 0.37
    }
    
    func ExampleExp2() {
    	fmt.Printf("%.2f\n", math.Exp2(1))
    	fmt.Printf("%.2f\n", math.Exp2(-3))
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 07 18:09:53 UTC 2021
    - 3.7K bytes
    - Viewed (0)
  5. test/map.go

    	// test len
    	if len(mib) != count {
    		panic(fmt.Sprintf("len(mib) = %d\n", len(mib)))
    	}
    	if len(mii) != count {
    		panic(fmt.Sprintf("len(mii) = %d\n", len(mii)))
    	}
    	if len(mfi) != count {
    		panic(fmt.Sprintf("len(mfi) = %d\n", len(mfi)))
    	}
    	if len(mif) != count {
    		panic(fmt.Sprintf("len(mif) = %d\n", len(mif)))
    	}
    	if len(msi) != count {
    		panic(fmt.Sprintf("len(msi) = %d\n", len(msi)))
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 06 21:02:55 UTC 2014
    - 14.9K bytes
    - Viewed (0)
  6. src/slices/example_test.go

    	grow := slices.Grow(numbers, 2)
    	fmt.Println(cap(numbers))
    	fmt.Println(grow)
    	fmt.Println(len(grow))
    	fmt.Println(cap(grow))
    	// Output:
    	// 4
    	// [0 42 -10 8]
    	// 4
    	// 8
    }
    
    func ExampleClip() {
    	a := [...]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
    	s := a[:4:10]
    	clip := slices.Clip(s)
    	fmt.Println(cap(s))
    	fmt.Println(clip)
    	fmt.Println(len(clip))
    	fmt.Println(cap(clip))
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:28:50 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  7. src/regexp/example_test.go

    	fmt.Println(a.Split("banana", 1))
    	fmt.Println(a.Split("banana", 2))
    	zp := regexp.MustCompile(`z+`)
    	fmt.Println(zp.Split("pizza", -1))
    	fmt.Println(zp.Split("pizza", 0))
    	fmt.Println(zp.Split("pizza", 1))
    	fmt.Println(zp.Split("pizza", 2))
    	// Output:
    	// [b n n ]
    	// []
    	// [banana]
    	// [b nana]
    	// [pi a]
    	// []
    	// [pizza]
    	// [pi a]
    }
    
    func ExampleRegexp_Expand() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:22:53 UTC 2023
    - 11.1K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/test/testdata/gen/zeroGen.go

    		// type for test
    		fmt.Fprintf(w, "type Z%du1 struct {\n", s)
    		fmt.Fprintf(w, "  b   bool\n")
    		fmt.Fprintf(w, "  val [%d]byte\n", s)
    		fmt.Fprintf(w, "}\n")
    
    		fmt.Fprintf(w, "type Z%du2 struct {\n", s)
    		fmt.Fprintf(w, "  i   uint16\n")
    		fmt.Fprintf(w, "  val [%d]byte\n", s)
    		fmt.Fprintf(w, "}\n")
    
    		// function being tested
    		fmt.Fprintf(w, "//go:noinline\n")
    		fmt.Fprintf(w, "func zero%du1_ssa(t *Z%du1) {\n", s, s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 4.1K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/util/errors/errors_test.go

    			nil,
    		},
    		{
    			aggregate{fmt.Errorf("abc")},
    			aggregate{fmt.Errorf("abc")},
    		},
    		{
    			aggregate{fmt.Errorf("abc"), fmt.Errorf("def"), fmt.Errorf("ghi")},
    			aggregate{fmt.Errorf("abc"), fmt.Errorf("def"), fmt.Errorf("ghi")},
    		},
    		{
    			aggregate{aggregate{fmt.Errorf("abc")}},
    			aggregate{fmt.Errorf("abc")},
    		},
    		{
    			aggregate{aggregate{aggregate{fmt.Errorf("abc")}}},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Jul 24 13:16:21 UTC 2022
    - 12.7K bytes
    - Viewed (0)
  10. src/unicode/utf8/example_test.go

    	fmt.Println("runes =", utf8.RuneCountInString(str))
    	// Output:
    	// bytes = 13
    	// runes = 9
    }
    
    func ExampleRuneLen() {
    	fmt.Println(utf8.RuneLen('a'))
    	fmt.Println(utf8.RuneLen('界'))
    	// Output:
    	// 1
    	// 3
    }
    
    func ExampleRuneStart() {
    	buf := []byte("a界")
    	fmt.Println(utf8.RuneStart(buf[0]))
    	fmt.Println(utf8.RuneStart(buf[1]))
    	fmt.Println(utf8.RuneStart(buf[2]))
    	// Output:
    	// true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 05 21:29:18 UTC 2021
    - 3.6K bytes
    - Viewed (0)
Back to top