Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 146 for newInt (0.16 sec)

  1. src/cmd/compile/internal/typecheck/typecheck.go

    		base.Fatalf("stringtoarraylit %v", n)
    	}
    
    	var l []ir.Node
    	i := 0
    	for _, r := range ir.StringVal(n.X) {
    		l = append(l, ir.NewKeyExpr(base.Pos, ir.NewInt(base.Pos, int64(i)), ir.NewInt(base.Pos, int64(r))))
    		i++
    	}
    
    	return Expr(ir.NewCompLitExpr(base.Pos, ir.OCOMPLIT, n.Type(), l))
    }
    
    func checkmake(t *types.Type, arg string, np *ir.Node) bool {
    	n := *np
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
  2. src/math/big/int.go

    	z.neg = neg
    	return z
    }
    
    // SetUint64 sets z to x and returns z.
    func (z *Int) SetUint64(x uint64) *Int {
    	z.abs = z.abs.setUint64(x)
    	z.neg = false
    	return z
    }
    
    // NewInt allocates and returns a new [Int] set to x.
    func NewInt(x int64) *Int {
    	// This code is arranged to be inlineable and produce
    	// zero allocations when inlined. See issue 29951.
    	u := uint64(x)
    	if x < 0 {
    		u = -u
    	}
    	var abs []Word
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 14 17:02:38 UTC 2024
    - 33.1K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go

    	if base == 10 {
    		amount.SetScale(amount.Scale() + Scale(exponent).infScale())
    	} else if base == 2 {
    		// numericSuffix = 2 ** exponent
    		numericSuffix := big.NewInt(1).Lsh(bigOne, uint(exponent))
    		ub := amount.UnscaledBig()
    		amount.SetUnscaledBig(ub.Mul(ub, numericSuffix))
    	}
    
    	// Cap at min/max bounds.
    	sign := amount.Sign()
    	if sign == -1 {
    		amount.Neg(amount)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:10 UTC 2024
    - 23.8K bytes
    - Viewed (0)
  4. src/crypto/tls/tls_test.go

    	keyDER, err := x509.MarshalPKCS8PrivateKey(key)
    	if err != nil {
    		t.Fatal(err)
    	}
    	keyPEM := pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: keyDER})
    	tmpl := &x509.Certificate{
    		SerialNumber: big.NewInt(1),
    		Subject:      pkix.Name{CommonName: "test"},
    	}
    	certDER, err := x509.CreateCertificate(rand.Reader, tmpl, tmpl, key.Public(), key)
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 60.5K bytes
    - Viewed (0)
  5. src/html/template/exec_test.go

    	NonEmptyInterfacePtS:      &siVal,
    	NonEmptyInterfaceTypedNil: (*T)(nil),
    	Str:                       bytes.NewBuffer([]byte("foozle")),
    	Err:                       errors.New("erroozle"),
    	PI:                        newInt(23),
    	PS:                        newString("a string"),
    	PSI:                       newIntSlice(21, 22, 23),
    	BinaryFunc:                func(a, b string) string { return fmt.Sprintf("[%s=%s]", a, b) },
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 24 21:59:12 UTC 2024
    - 57.6K bytes
    - Viewed (0)
  6. src/text/template/exec_test.go

    	NonEmptyInterfacePtS:      &siVal,
    	NonEmptyInterfaceTypedNil: (*T)(nil),
    	Str:                       bytes.NewBuffer([]byte("foozle")),
    	Err:                       errors.New("erroozle"),
    	PI:                        newInt(23),
    	PS:                        newString("a string"),
    	PSI:                       newIntSlice(21, 22, 23),
    	BinaryFunc:                func(a, b string) string { return fmt.Sprintf("[%s=%s]", a, b) },
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 22:23:55 UTC 2024
    - 60.1K bytes
    - Viewed (0)
  7. src/crypto/tls/handshake_client_test.go

    	serverWCC := &writeCountingConn{Conn: s}
    
    	serverConfig := testConfig.Clone()
    
    	// Cause a signature-time error
    	brokenKey := rsa.PrivateKey{PublicKey: testRSAPrivateKey.PublicKey}
    	brokenKey.D = big.NewInt(42)
    	serverConfig.Certificates = []Certificate{{
    		Certificate: [][]byte{testRSACertificate},
    		PrivateKey:  &brokenKey,
    	}}
    
    	go func() {
    		Server(serverWCC, serverConfig).Handshake()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 88.7K bytes
    - Viewed (0)
  8. src/runtime/pprof/pprof_test.go

    func TestMathBigDivide(t *testing.T) {
    	testCPUProfile(t, nil, func(duration time.Duration) {
    		t := time.After(duration)
    		pi := new(big.Int)
    		for {
    			for i := 0; i < 100; i++ {
    				n := big.NewInt(2646693125139304345)
    				d := big.NewInt(842468587426513207)
    				pi.Div(n, d)
    			}
    			select {
    			case <-t:
    				return
    			default:
    			}
    		}
    	})
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 68.8K bytes
    - Viewed (0)
  9. src/encoding/json/decode_test.go

    		PText:     new(MustNotUnmarshalText),
    		PStruct:   new(struct{}),
    		PBuffer:   new(bytes.Buffer),
    		Raw:       RawMessage("123"),
    		Time:      time.Unix(123456789, 0),
    		BigInt:    *big.NewInt(123),
    	}
    
    	before := nulls.Time.String()
    
    	err := Unmarshal(jsonData, &nulls)
    	if err != nil {
    		t.Errorf("Unmarshal of null values failed: %v", err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 16:40:14 UTC 2024
    - 67.6K bytes
    - Viewed (0)
  10. cmd/test-utils_test.go

    	if err != nil {
    		return nil, nil, fmt.Errorf("failed to generate private key: %w", err)
    	}
    
    	notBefore := time.Now()
    	notAfter := notBefore.Add(validFor)
    
    	serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
    	serialNumber, err := crand.Int(crand.Reader, serialNumberLimit)
    	if err != nil {
    		return nil, nil, fmt.Errorf("failed to generate serial number: %w", err)
    	}
    
    	template := x509.Certificate{
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 10 15:50:49 UTC 2024
    - 76.9K bytes
    - Viewed (0)
Back to top