- Sort Score
- Result 10 results
- Languages All
Results 51 - 60 of 319 for newInt (0.17 sec)
-
src/crypto/elliptic/p256_test.go
ggx, ggy := p256.ScalarBaseMult(two) if x.Cmp(ggx) != 0 || y.Cmp(ggy) != 0 { t.Errorf("1×G + 1×G = (%d, %d), should be (%d, %d)", x, y, ggx, ggy) } minusOne := new(big.Int).Sub(p256.Params().N, big.NewInt(1)) // 1×G + (-1)×G = ∞ x, y = p256.CombinedMult(gx, gy, one, minusOne.Bytes()) if x.Sign() != 0 || y.Sign() != 0 { t.Errorf("1×G + (-1)×G = (%d, %d), should be ∞", x, y) } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 31 16:58:48 UTC 2022 - 4.2K bytes - Viewed (0) -
src/go/constant/value_test.go
{Bool, false, false}, {String, "hello", "hello"}, {Int, int64(1), int64(1)}, {Int, big.NewInt(10), int64(10)}, {Int, new(big.Int).Lsh(big.NewInt(1), 62), int64(1 << 62)}, dup(Int, new(big.Int).Lsh(big.NewInt(1), 63)), {Float, big.NewFloat(0), floatVal0.val}, dup(Float, big.NewFloat(2.0)), dup(Float, big.NewRat(1, 3)), } { val := Make(test.arg) got := Val(val)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 13 18:45:54 UTC 2021 - 15.6K bytes - Viewed (0) -
pkg/controller/nodeipam/ipam/cidrset/cidr_set.go
return 0, fmt.Errorf("CIDR: %v/%v is out of the range of CIDR allocator", ip, s.nodeMaskSize) } return int(cidrIndex), nil } if ip.To16() != nil { bigIP := big.NewInt(0).SetBytes(s.clusterCIDR.IP) bigIP = bigIP.Xor(bigIP, big.NewInt(0).SetBytes(ip)) cidrIndexBig := bigIP.Rsh(bigIP, uint(net.IPv6len*8-s.nodeMaskSize)) cidrIndex := cidrIndexBig.Uint64() if cidrIndex >= uint64(s.maxCIDRs) {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu May 11 08:53:03 UTC 2023 - 9.4K bytes - Viewed (0) -
src/crypto/x509/boring_test.go
org := name parentOrg := "" if i := strings.Index(org, "_"); i >= 0 { org = org[:i] parentOrg = name[i+1:] } tmpl := &Certificate{ SerialNumber: big.NewInt(1), Subject: pkix.Name{ Organization: []string{org}, }, NotBefore: time.Unix(0, 0), NotAfter: time.Unix(0, 0), KeyUsage: KeyUsageKeyEncipherment | KeyUsageDigitalSignature,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Nov 17 17:38:47 UTC 2022 - 3.7K bytes - Viewed (0) -
src/math/big/prime_test.go
if c.ProbablyPrime(nreps) || nreps != 1 && c.ProbablyPrime(1) || c.ProbablyPrime(0) { t.Errorf("#%d composite found to be prime (%s)", i, s) } } // check that ProbablyPrime panics if n <= 0 c := NewInt(11) // a prime for _, n := range []int{-1, 0, 1} { func() { defer func() { if n < 0 && recover() == nil { t.Fatalf("expected panic from ProbablyPrime(%d)", n) } }()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 12:54:00 UTC 2019 - 7.1K bytes - Viewed (0) -
src/net/http/triv.go
package main import ( "expvar" "flag" "fmt" "io" "log" "net/http" "os" "os/exec" "strconv" "strings" "sync" ) // hello world, the web server var helloRequests = expvar.NewInt("hello-requests") func HelloServer(w http.ResponseWriter, req *http.Request) { helloRequests.Add(1) io.WriteString(w, "hello, world!\n") } // Simple counter server. POSTing to it will set the value.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 10 03:29:50 UTC 2024 - 3.2K bytes - Viewed (0) -
src/crypto/internal/nistec/generate.go
log.Fatal(err) } // If p = 3 mod 4, implement modular square root by exponentiation. mod4 := new(big.Int).Mod(c.Params.P, big.NewInt(4)) if mod4.Cmp(big.NewInt(3)) != 0 { continue } exp := new(big.Int).Add(c.Params.P, big.NewInt(1)) exp.Div(exp, big.NewInt(4)) tmp, err := os.CreateTemp("", "addchain-"+p) if err != nil { log.Fatal(err) } defer os.Remove(tmp.Name())
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:29:44 UTC 2024 - 19.7K bytes - Viewed (0) -
src/encoding/asn1/asn1_test.go
{"tag:17", fieldParameters{tag: newInt(17)}}, {"optional,explicit,default:42,tag:17", fieldParameters{optional: true, explicit: true, defaultValue: newInt64(42), tag: newInt(17)}}, {"optional,explicit,default:42,tag:17,rubbish1", fieldParameters{optional: true, explicit: true, application: false, defaultValue: newInt64(42), tag: newInt(17), stringType: 0, timeType: 0, set: false, omitEmpty: false}},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 29 18:24:36 UTC 2023 - 43.6K bytes - Viewed (0) -
src/math/big/doc.go
y := new(Float) // y is a *Float of value 0 Alternatively, new values can be allocated and initialized with factory functions of the form: func NewT(v V) *T For instance, [NewInt](x) returns an *[Int] set to the value of the int64 argument x, [NewRat](a, b) returns a *[Rat] set to the fraction a/b where a and b are int64 values, and [NewFloat](f) returns a *[Float] initialized
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 11:59:09 UTC 2023 - 3.8K bytes - Viewed (0) -
pkg/registry/core/service/ipallocator/ipallocator.go
// but using netip.Addr instead of net.IP func addOffsetAddress(address netip.Addr, offset uint64) (netip.Addr, error) { addressBytes := address.AsSlice() addressBig := big.NewInt(0).SetBytes(addressBytes) r := big.NewInt(0).Add(addressBig, big.NewInt(int64(offset))).Bytes() // r must be 4 or 16 bytes depending of the ip family // bigInt conversion to bytes will not take this into consideration
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Oct 31 21:05:04 UTC 2023 - 17K bytes - Viewed (0)