Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for RoundUp (0.18 sec)

  1. src/cmd/compile/internal/types/universe.go

    	}
    
    	SlicePtrOffset = 0
    	SliceLenOffset = RoundUp(SlicePtrOffset+int64(PtrSize), int64(PtrSize))
    	SliceCapOffset = RoundUp(SliceLenOffset+int64(PtrSize), int64(PtrSize))
    	SliceSize = RoundUp(SliceCapOffset+int64(PtrSize), int64(PtrSize))
    
    	// string is same as slice wo the cap
    	StringSize = RoundUp(SliceLenOffset+int64(PtrSize), int64(PtrSize))
    
    	for et := Kind(0); et < NTYPE; et++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jan 26 21:56:49 UTC 2023
    - 4K bytes
    - Viewed (0)
  2. src/math/big/decimal_test.go

    		d.round(test.n)
    		if got := d.String(); got != test.even {
    			t.Errorf("round(%d, %d) = %s; want %s", test.x, test.n, got, test.even)
    		}
    
    		d.init(x, 0)
    		d.roundUp(test.n)
    		if got := d.String(); got != test.up {
    			t.Errorf("roundUp(%d, %d) = %s; want %s", test.x, test.n, got, test.up)
    		}
    	}
    }
    
    var sink string
    
    func BenchmarkDecimalConversion(b *testing.B) {
    	for i := 0; i < b.N; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 18 05:54:35 UTC 2016
    - 3.3K bytes
    - Viewed (0)
  3. src/strconv/decimal_test.go

    		s = d.String()
    		if s != test.round {
    			t.Errorf("Decimal %v Round %d = %v, want %v",
    				test.i, test.nd, s, test.down)
    		}
    		d = NewDecimal(test.i)
    		d.RoundUp(test.nd)
    		s = d.String()
    		if s != test.up {
    			t.Errorf("Decimal %v RoundUp %d = %v, want %v",
    				test.i, test.nd, s, test.up)
    		}
    	}
    }
    
    type roundIntTest struct {
    	i     uint64
    	shift int
    	int   uint64
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 3K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go

    func GetScaledValueFromIntOrPercent(intOrPercent *IntOrString, total int, roundUp bool) (int, error) {
    	if intOrPercent == nil {
    		return 0, errors.New("nil value for IntOrString")
    	}
    	value, isPercent, err := getIntOrPercentValueSafely(intOrPercent)
    	if err != nil {
    		return 0, fmt.Errorf("invalid value for IntOrString: %v", err)
    	}
    	if isPercent {
    		if roundUp {
    			value = int(math.Ceil(float64(value) * (float64(total)) / 100))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:09 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  5. src/vendor/golang.org/x/net/route/sys.go

    		nativeEndian = littleEndian
    	} else {
    		nativeEndian = bigEndian
    	}
    	// might get overridden in probeRoutingStack
    	rtmVersion = syscall.RTM_VERSION
    	kernelAlign, wireFormats = probeRoutingStack()
    }
    
    func roundup(l int) int {
    	if l == 0 {
    		return kernelAlign
    	}
    	return (l + kernelAlign - 1) &^ (kernelAlign - 1)
    }
    
    type wireFormat struct {
    	extOff  int // offset of header extension
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 940 bytes
    - Viewed (0)
  6. src/go/doc/testdata/benchmark.go

    	for n > 10 {
    		n = n / 10
    		tens++
    	}
    	// result = 10^tens
    	result := 1
    	for i := 0; i < tens; i++ {
    		result *= 10
    	}
    	return result
    }
    
    // roundUp rounds x up to a number of the form [1eX, 2eX, 5eX].
    func roundUp(n int) int {
    	base := roundDown10(n)
    	if n < (2 * base) {
    		return 2 * base
    	}
    	if n < (5 * base) {
    		return 5 * base
    	}
    	return 10 * base
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Oct 02 02:28:27 UTC 2022
    - 7.4K bytes
    - Viewed (0)
  7. src/math/big/decimal.go

    // If n < 0, x remains unchanged.
    func (x *decimal) round(n int) {
    	if n < 0 || n >= len(x.mant) {
    		return // nothing to do
    	}
    
    	if shouldRoundUp(x, n) {
    		x.roundUp(n)
    	} else {
    		x.roundDown(n)
    	}
    }
    
    func (x *decimal) roundUp(n int) {
    	if n < 0 || n >= len(x.mant) {
    		return // nothing to do
    	}
    	// 0 <= n < len(x.mant)
    
    	// find first digit < '9'
    	for n > 0 && x.mant[n-1] >= '9' {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 29 22:45:29 UTC 2020
    - 6.6K bytes
    - Viewed (0)
  8. src/go/doc/testdata/testing.1.golden

    	// 
    	func min(x, y int) int
    
    	// 
    	func parseCpuList()
    
    	// roundDown10 rounds a number down to the nearest power of 10. 
    	func roundDown10(n int) int
    
    	// roundUp rounds x up to a number of the form [1eX, 2eX, 5eX]. 
    	func roundUp(n int) int
    
    	// startAlarm starts an alarm if requested. 
    	func startAlarm()
    
    	// stopAlarm turns off the alarm. 
    	func stopAlarm()
    
    	// 
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 8.4K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/api/resource/amount.go

    // was lost. (1.1e5).AsScale(5) would return 1.1e5, but (1.1e5).AsScale(6) would return 1e6.
    func (a infDecAmount) AsScale(scale Scale) (infDecAmount, bool) {
    	tmp := &inf.Dec{}
    	tmp.Round(a.Dec, scale.infScale(), inf.RoundUp)
    	return infDecAmount{tmp}, tmp.Cmp(a.Dec) == 0
    }
    
    // AsCanonicalBytes accepts a buffer to write the base-10 string value of this field to, and returns
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 13 19:42:28 UTC 2023
    - 9.3K bytes
    - Viewed (0)
  10. pkg/quota/v1/evaluator/core/persistent_volume_claims.go

    	var result *resource.Quantity
    	roundUpFunc := func(i *resource.Quantity) *resource.Quantity {
    		roundedRequest := i.DeepCopy()
    		if !roundedRequest.RoundUp(0) {
    			// Ensure storage requests are counted as whole byte values, to pass resourcequota validation.
    			// See https://issue.k8s.io/94313
    			return &roundedRequest
    		}
    		return i
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 23 23:36:24 UTC 2022
    - 9.2K bytes
    - Viewed (0)
Back to top