- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 319 for newInt (0.15 sec)
-
staging/src/k8s.io/apimachinery/pkg/api/resource/scale_int_test.go
want int64 }{ // remain scale {big.NewInt(1000), 0, 0, 1000}, // scale down {big.NewInt(1000), 0, -3, 1}, {big.NewInt(1000), 3, 0, 1}, {big.NewInt(0), 3, 0, 0}, // always round up {big.NewInt(999), 3, 0, 1}, {big.NewInt(500), 3, 0, 1}, {big.NewInt(499), 3, 0, 1}, {big.NewInt(1), 3, 0, 1}, // large scaled value does not lose precision
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sun Feb 11 03:04:14 UTC 2018 - 2.1K bytes - Viewed (0) -
test/fixedbugs/issue29013b.go
} type Int struct { i int } func NewInt(v int) Int { return Int{i: v} } var Suites = []TestSuite{ Dicts, } var Dicts = TestSuite{ Tests: []Test{ { Want: map[Int]bool{NewInt(1): true}, }, { Want: map[Int]string{ NewInt(3): "3", }, }, }, } func main() { if Suites[0].Tests[0].Want.(map[Int]bool)[NewInt(3)] { panic("bad") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 03 16:48:21 UTC 2018 - 616 bytes - Viewed (0) -
test/fixedbugs/bug284.go
// Test cases for revised conversion rules. package main func main() { type NewInt int i0 := 0 var i1 int = 1 var i2 NewInt = 1 i0 = i0 i0 = i1 i0 = int(i2) i1 = i0 i1 = i1 i1 = int(i2) i2 = NewInt(i0) i2 = NewInt(i1) i2 = i2 type A1 [3]int type A2 [3]NewInt var a0 [3]int var a1 A1 var a2 A2 a0 = a0 a0 = a1
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Feb 17 04:49:59 UTC 2012 - 3.5K bytes - Viewed (0) -
test/fixedbugs/issue9604b.go
a = append(a, r.Lsh(r, t.bits-1).Sub(r, big.NewInt(1))) r = big.NewInt(1) a = append(a, r.Lsh(r, t.bits-1).Sub(r, big.NewInt(2))) r = big.NewInt(1) a = append(a, r.Lsh(r, t.bits-1).Neg(r)) r = big.NewInt(1) a = append(a, r.Lsh(r, t.bits-1).Neg(r).Add(r, big.NewInt(1))) } else { r := big.NewInt(1) a = append(a, r.Lsh(r, t.bits).Sub(r, big.NewInt(1))) r = big.NewInt(1)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:25 UTC 2023 - 4.8K bytes - Viewed (0) -
misc/cgo/gmp/pi.go
//go:build ignore package main import ( big "." "fmt" "runtime" ) var ( tmp1 = big.NewInt(0) tmp2 = big.NewInt(0) numer = big.NewInt(1) accum = big.NewInt(0) denom = big.NewInt(1) ten = big.NewInt(10) ) func extractDigit() int64 { if big.CmpInt(numer, accum) > 0 { return -1 } tmp1.Lsh(numer, 1).Add(tmp1, numer).Add(tmp1, accum)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 10 22:32:35 UTC 2023 - 1.3K bytes - Viewed (0) -
src/crypto/internal/nistec/p256_ordinv_test.go
} // Check inv(1) and inv(N+1) against math/big exp := new(big.Int).ModInverse(big.NewInt(1), N).FillBytes(make([]byte, 32)) big.NewInt(1).FillBytes(input) out, err = nistec.P256OrdInverse(input) if err != nil { t.Fatal(err) } if !bytes.Equal(out, exp) { t.Error("unexpected output for inv(1)") } new(big.Int).Add(N, big.NewInt(1)).FillBytes(input) out, err = nistec.P256OrdInverse(input) if err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 04 17:29:44 UTC 2024 - 2.3K bytes - Viewed (0) -
test/stackobj2.go
// Use both orderings to ensure the linked list isn't always in address order. var a, b T if n%3 == 0 { a.data = newInt(n) a.next = x a.next2 = x b.data = newInt(n - 1) b.next = &a b.next2 = &a x = &b } else { b.data = newInt(n) b.next = x b.next2 = x a.data = newInt(n - 1) a.next = &b a.next2 = &b x = &a } makelist(x, n-2) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Oct 03 19:54:29 UTC 2018 - 1.6K bytes - Viewed (0) -
pkg/registry/core/service/allocator/utils_test.go
// bigN is an integer that occupies more than one big.Word. bigN, ok := big.NewInt(0).SetString("10000000000000000000000000000000000000000000000000000000000000000", 16) if !ok { t.Fatal("Failed to set bigN") } tests := []struct { n *big.Int expected int }{ {n: big.NewInt(int64(0)), expected: 0}, {n: big.NewInt(int64(0xffffffffff)), expected: 40}, {n: bigN, expected: 1}, }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Oct 01 15:08:36 UTC 2021 - 1.5K bytes - Viewed (0) -
src/crypto/x509/oid.go
var ( first = big.NewInt(0) second = big.NewInt(0) ) if _, ok := first.SetString(firstNum, 10); !ok { return errInvalidOID } if _, ok := second.SetString(secondNum, 10); !ok { return errInvalidOID } if first.Cmp(big.NewInt(2)) > 0 || (first.Cmp(big.NewInt(2)) < 0 && second.Cmp(big.NewInt(40)) >= 0) { return errInvalidOID }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 04 19:10:38 UTC 2024 - 8.3K bytes - Viewed (0) -
src/math/big/int_test.go
z, x, y *Int } var sumZZ = []argZZ{ {NewInt(0), NewInt(0), NewInt(0)}, {NewInt(1), NewInt(1), NewInt(0)}, {NewInt(1111111110), NewInt(123456789), NewInt(987654321)}, {NewInt(-1), NewInt(-1), NewInt(0)}, {NewInt(864197532), NewInt(-123456789), NewInt(987654321)}, {NewInt(-1111111110), NewInt(-123456789), NewInt(-987654321)}, } var prodZZ = []argZZ{ {NewInt(0), NewInt(0), NewInt(0)}, {NewInt(0), NewInt(1), NewInt(0)},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 18:42:28 UTC 2024 - 58.5K bytes - Viewed (0)