- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for int64Multiply (0.22 sec)
-
staging/src/k8s.io/apimachinery/pkg/api/resource/math_test.go
{-mostPositive, -mostPositive, 1, false}, } { c, ok := int64Multiply(test.a, test.b) if c != test.c { t.Errorf("%v: unexpected result: %d", test, c) } if ok != test.ok { t.Errorf("%v: unexpected overflow: %t", test, ok) } // multiplication is commutative d, ok2 := int64Multiply(test.b, test.a) if c != d || ok != ok2 { t.Errorf("%v: not commutative: %d %t", test, d, ok2)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sun Jan 29 20:41:44 UTC 2017 - 5.1K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/api/resource/math.go
case a < 0 && b < 0: if c > 0 { return 0, false } if a == mostNegative && b == mostNegative { return 0, false } } return c, true } // int64Multiply returns a*b, or false if that would overflow or underflow int64. func int64Multiply(a, b int64) (int64, bool) { if a == 0 || b == 0 || a == 1 || b == 1 { return a * b, true } if a == mostNegative || b == mostNegative { return 0, false }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Jan 23 13:07:14 UTC 2020 - 7.3K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/api/resource/amount.go
a.scale = 0 return true case a.scale == 0: c, ok := int64Multiply(a.value, b) if !ok { return false } a.value = c case a.scale > 0: c, ok := int64Multiply(a.value, b) if !ok { return false } if _, ok = positiveScaleInt64(c, a.scale); !ok { return false } a.value = c default: c, ok := int64Multiply(a.value, b) if !ok { return false }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Oct 13 19:42:28 UTC 2023 - 9.3K bytes - Viewed (0)