Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for NewDec (0.17 sec)

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

    	bigThousand = big.NewInt(1000)
    	big1024     = big.NewInt(1024)
    
    	// Commonly needed inf.Dec values-- treat as read only!
    	decZero = inf.NewDec(0, 0)
    	decOne  = inf.NewDec(1, 0)
    
    	// Largest (in magnitude) number allowed.
    	maxAllowed = infDecAmount{inf.NewDec((1<<63)-1, 0)} // == max int64
    
    	// The maximum value we can represent milli-units for.
    	// Compare with the return value of Quantity.Value() to
    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/quantity.go

    func (q *Quantity) Mul(y int64) bool {
    	q.s = ""
    	if q.d.Dec == nil && q.i.Mul(y) {
    		return true
    	}
    	return q.ToDec().d.Dec.Mul(q.d.Dec, inf.NewDec(y, inf.Scale(0))).UnscaledBig().IsInt64()
    }
    
    // Cmp returns 0 if the quantity is equal to y, -1 if the quantity is less than y, or 1 if the
    // quantity is greater than y.
    func (q *Quantity) Cmp(y Quantity) int {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:10 UTC 2024
    - 23.8K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go

    	bigMostNegative = big.NewInt(mostNegative)
    )
    
    func dec(i int64, exponent int) infDecAmount {
    	// See the below test-- scale is the negative of an exponent.
    	return infDecAmount{inf.NewDec(i, inf.Scale(-exponent))}
    }
    
    func bigDec(i *big.Int, exponent int) infDecAmount {
    	// See the below test-- scale is the negative of an exponent.
    	return infDecAmount{inf.NewDecBig(i, inf.Scale(-exponent))}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:10 UTC 2024
    - 49.4K bytes
    - Viewed (0)
  4. src/cmd/link/internal/ld/macho_combine_dwarf.go

    		if err != nil {
    			return nil, nil, err
    		}
    
    		newSec := *sect
    		newSec.Offset = uint32(dwarfseg.Offset) + uint32(buf.Len())
    		newSec.Addr = dwarfseg.Addr + uint64(buf.Len())
    		if compressed {
    			newSec.Name = "__z" + sect.Name[2:]
    			newSec.Size = uint64(len(contents))
    		}
    		sects = append(sects, &newSec)
    		buf.Write(contents)
    	}
    	return sects, buf.Bytes(), nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 18:45:27 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  5. src/time/time_test.go

    	for i := int64(0); i < 100; i++ {
    		sec := notMonoTime.Unix()
    		notMonoTime = notMonoTime.Add(Duration(i * 1e9))
    		if newSec := notMonoTime.Unix(); newSec != sec+i && newSec+UnixToInternal != maxInt64 {
    			t.Fatalf("time ext: %d overflows with positive delta, overflow threshold: %d", newSec, maxInt64)
    		}
    	}
    
    	// Test it with negative delta.
    	maxInt64 = -maxInt64
    	notMonoTime = NotMonoNegativeTime
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:13:47 UTC 2024
    - 56.5K bytes
    - Viewed (0)
Back to top