Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 310 for roundup (0.12 sec)

  1. src/strconv/ftoaryu.go

    	max := uint64pow10[prec]
    	trimmed := 0
    	for m >= max {
    		a, b := m/10, m%10
    		m = a
    		trimmed++
    		if b > 5 {
    			roundUp = true
    		} else if b < 5 {
    			roundUp = false
    		} else { // b == 5
    			// round up if there are trailing digits,
    			// or if the new value of m is odd (round-to-even convention)
    			roundUp = trunc || m&1 == 1
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 00:28:56 UTC 2022
    - 15.7K bytes
    - Viewed (0)
  2. src/vendor/golang.org/x/net/route/address.go

    	l := int(b[0])
    	if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
    		// On Darwin, an address in the kernel form is also
    		// used as a message filler.
    		if l == 0 || len(b) > roundup(l) {
    			l = roundup(l)
    		}
    	} else {
    		l = roundup(l)
    	}
    	if len(b) < l {
    		return 0, nil, errInvalidAddr
    	}
    	// Don't reorder case expressions.
    	// The case expressions for IPv6 must come first.
    	const (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 9.9K bytes
    - Viewed (0)
  3. 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)
  4. src/crypto/tls/conn_test.go

    package tls
    
    import (
    	"bytes"
    	"io"
    	"net"
    	"testing"
    )
    
    func TestRoundUp(t *testing.T) {
    	if roundUp(0, 16) != 0 ||
    		roundUp(1, 16) != 16 ||
    		roundUp(15, 16) != 16 ||
    		roundUp(16, 16) != 16 ||
    		roundUp(17, 16) != 32 {
    		t.Error("roundUp broken")
    	}
    }
    
    // will be initialized with {0, 255, 255, ..., 255}
    var padding255Bad = [256]byte{}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 21:35:01 UTC 2023
    - 10.5K bytes
    - Viewed (0)
  5. src/math/big/decimal_test.go

    		}
    
    		d.init(x, 0)
    		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
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 18 05:54:35 UTC 2016
    - 3.3K bytes
    - Viewed (0)
  6. src/strconv/decimal_test.go

    				test.i, test.nd, s, test.down)
    		}
    		d = NewDecimal(test.i)
    		d.Round(test.nd)
    		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)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 3K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types/size.go

    // machine size and rounding alignment is dictated around
    // the size of a pointer, set in gc.Main (see ../gc/main.go).
    var defercalc int
    
    // RoundUp rounds o to a multiple of r, r is a power of 2.
    func RoundUp(o int64, r int64) int64 {
    	if r < 1 || r > 8 || r&(r-1) != 0 {
    		base.Fatalf("Round %d", r)
    	}
    	return (o + r - 1) &^ (r - 1)
    }
    
    // expandiface computes the method set for interface type t by
    // expanding embedded interfaces.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 15K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go

    	tests := []struct {
    		input     IntOrString
    		total     int
    		roundUp   bool
    		expectErr bool
    		expectVal int
    	}{
    		{
    			input:     FromInt32(123),
    			expectErr: false,
    			expectVal: 123,
    		},
    		{
    			input:     FromString("90%"),
    			total:     100,
    			roundUp:   true,
    			expectErr: false,
    			expectVal: 90,
    		},
    		{
    			input:     FromString("90%"),
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:09 UTC 2024
    - 14.3K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top