Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 119 for newInt (0.12 sec)

  1. src/crypto/internal/mlkem768/mlkem768_test.go

    }
    
    func TestZetas(t *testing.T) {
    	ζ := big.NewInt(17)
    	q := big.NewInt(q)
    	for k, zeta := range zetas {
    		// ζ^BitRev7(k) mod q
    		exp := new(big.Int).Exp(ζ, big.NewInt(int64(BitRev7(uint8(k)))), q)
    		if big.NewInt(int64(zeta)).Cmp(exp) != 0 {
    			t.Errorf("zetas[%d] = %v, expected %v", k, zeta, exp)
    		}
    	}
    }
    
    func TestGammas(t *testing.T) {
    	ζ := big.NewInt(17)
    	q := big.NewInt(q)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 15:27:18 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  2. src/go/constant/value.go

    			if !is63bit(a) || !is63bit(b) {
    				return makeInt(newInt().Add(big.NewInt(a), big.NewInt(b)))
    			}
    			c = a + b
    		case token.SUB:
    			if !is63bit(a) || !is63bit(b) {
    				return makeInt(newInt().Sub(big.NewInt(a), big.NewInt(b)))
    			}
    			c = a - b
    		case token.MUL:
    			if !is32bit(a) || !is32bit(b) {
    				return makeInt(newInt().Mul(big.NewInt(a), big.NewInt(b)))
    			}
    			c = a * b
    		case token.QUO:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 34K bytes
    - Viewed (0)
  3. src/crypto/internal/bigmod/nat_test.go

    	N, _ := NewModulusFromBig(n)
    	A := NewNat().setBig(a).ExpandFor(N)
    	B := NewNat().setBig(b).ExpandFor(N)
    
    	if A.Mul(B, N).IsZero() != 1 {
    		t.Error("a * b mod (a * b) != 0")
    	}
    
    	i := new(big.Int).ModInverse(a, b)
    	N, _ = NewModulusFromBig(b)
    	A = NewNat().setBig(a).ExpandFor(N)
    	I := NewNat().setBig(i).ExpandFor(N)
    	one := NewNat().setBig(big.NewInt(1)).ExpandFor(N)
    
    	if A.Mul(I, N).Equal(one) != 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 12 00:56:20 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  4. src/math/big/ratconv_test.go

    	}
    }
    
    func BenchmarkFloatPrecInexact(b *testing.B) {
    	for _, n := range []int{1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6} {
    		// d := 5^n + 1
    		d := NewInt(5)
    		p := NewInt(int64(n))
    		d.Exp(d, p, nil)
    		d.Add(d, NewInt(1))
    
    		// r := 1/d
    		var r Rat
    		r.SetFrac(NewInt(1), d)
    
    		b.Run(fmt.Sprint(n), func(b *testing.B) {
    			for i := 0; i < b.N; i++ {
    				_, ok := r.FloatPrec()
    				if ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 15 22:16:34 UTC 2023
    - 19.3K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/walk/range.go

    		// if hv2 < utf8.RuneSelf
    		nif := ir.NewIfStmt(base.Pos, nil, nil, nil)
    		nif.Cond = ir.NewBinaryExpr(base.Pos, ir.OLT, hv2, ir.NewInt(base.Pos, utf8.RuneSelf))
    
    		// hv1++
    		nif.Body = []ir.Node{ir.NewAssignStmt(base.Pos, hv1, ir.NewBinaryExpr(base.Pos, ir.OADD, hv1, ir.NewInt(base.Pos, 1)))}
    
    		// } else {
    		// hv2, hv1 = decoderune(ha, hv1)
    		fn := typecheck.LookupRuntime("decoderune")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:33 UTC 2023
    - 17.6K bytes
    - Viewed (0)
  6. pkg/registry/core/service/portallocator/allocator_test.go

    	}
    }
    
    func TestForEach(t *testing.T) {
    	pr, err := net.ParsePortRange("10000-10200")
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	testCases := []sets.Int{
    		sets.NewInt(),
    		sets.NewInt(10000),
    		sets.NewInt(10000, 10200),
    		sets.NewInt(10000, 10099, 10200),
    	}
    
    	for i, tc := range testCases {
    		r, err := NewInMemory(*pr)
    		if err != nil {
    			t.Fatal(err)
    		}
    
    		for port := range tc {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 08 07:15:02 UTC 2024
    - 14K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/builtin.go

    		//     panicmakeslicecap()
    		// }
    		nif := ir.NewIfStmt(base.Pos, ir.NewBinaryExpr(base.Pos, ir.OGT, typecheck.Conv(l, types.Types[types.TUINT64]), ir.NewInt(base.Pos, i)), nil, nil)
    		niflen := ir.NewIfStmt(base.Pos, ir.NewBinaryExpr(base.Pos, ir.OLT, l, ir.NewInt(base.Pos, 0)), nil, nil)
    		niflen.Body = []ir.Node{mkcall("panicmakeslicelen", nil, init)}
    		nif.Body.Append(niflen, mkcall("panicmakeslicecap", nil, init))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:35:22 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/walk/complit.go

    		lhs.RType = n.RType
    
    		zero := ir.NewAssignStmt(base.Pos, i, ir.NewInt(base.Pos, 0))
    		cond := ir.NewBinaryExpr(base.Pos, ir.OLT, i, ir.NewInt(base.Pos, tk.NumElem()))
    		incr := ir.NewAssignStmt(base.Pos, i, ir.NewBinaryExpr(base.Pos, ir.OADD, i, ir.NewInt(base.Pos, 1)))
    
    		var body ir.Node = ir.NewAssignStmt(base.Pos, lhs, rhs)
    		body = typecheck.Stmt(body)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:03:54 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/walk/switch.go

    		func(i int) ir.Node {
    			return ir.NewBinaryExpr(base.Pos, ir.OLE, s.hashName, ir.NewInt(base.Pos, int64(cc[i-1].hash)))
    		},
    		func(i int, nif *ir.IfStmt) {
    			// TODO(mdempsky): Omit hash equality check if
    			// there's only one type.
    			c := cc[i]
    			nif.Cond = ir.NewBinaryExpr(base.Pos, ir.OEQ, s.hashName, ir.NewInt(base.Pos, int64(c.hash)))
    			nif.Body.Append(c.body.Take()...)
    		},
    	)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/walk/assign.go

    		ptr2, len2 := backingArrayPtrLen(l2)
    
    		fn := typecheck.LookupRuntime("slicecopy", ptr1.Type().Elem(), ptr2.Type().Elem())
    		ncopy = mkcall1(fn, types.Types[types.TINT], &nodes, ptr1, len1, ptr2, len2, ir.NewInt(base.Pos, elemtype.Size()))
    	} else {
    		// memmove(&s[idx], &l2[0], len(l2)*sizeof(T))
    		ix := ir.NewIndexExpr(base.Pos, s, idx)
    		ix.SetBounded(true)
    		addr := typecheck.NodAddr(ix)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:09:06 UTC 2024
    - 20.3K bytes
    - Viewed (0)
Back to top