Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for int64MultiplyScale (1.11 sec)

  1. staging/src/k8s.io/apimachinery/pkg/api/resource/math.go

    		return int64MultiplyScale100(base)
    	case 3:
    		return int64MultiplyScale1000(base)
    	case 6:
    		return int64MultiplyScale(base, 1000000)
    	case 9:
    		return int64MultiplyScale(base, 1000000000)
    	default:
    		value := base
    		var ok bool
    		for i := Scale(0); i < scale; i++ {
    			if value, ok = int64MultiplyScale(value, 10); !ok {
    				return 0, false
    			}
    		}
    		return value, true
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jan 23 13:07:14 UTC 2020
    - 7.3K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/api/resource/math_test.go

    	for _, a := range []int64{0, -1, 1, 10, -10, mostPositive, mostNegative, -mostPositive} {
    		for _, b := range []int64{1, 2, 10, 100, 1000, mostPositive} {
    			expect, expectOk := int64Multiply(a, b)
    
    			c, ok := int64MultiplyScale(a, b)
    			if c != expect {
    				t.Errorf("%d*%d: unexpected result: %d", a, b, c)
    			}
    			if ok != expectOk {
    				t.Errorf("%d*%d: unexpected overflow: %t", a, b, ok)
    			}
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Jan 29 20:41:44 UTC 2017
    - 5.1K bytes
    - Viewed (0)
Back to top