Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 36 for Log2 (0.04 sec)

  1. android/guava-tests/test/com/google/common/math/LongMathTest.java

      /* Relies on the correctness of BigIntegerMath.log2 for all modes except UNNECESSARY. */
      public void testLog2MatchesBigInteger() {
        for (long x : POSITIVE_LONG_CANDIDATES) {
          for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) {
            // The BigInteger implementation is tested separately, use it as the reference.
            assertEquals(BigIntegerMath.log2(valueOf(x), mode), LongMath.log2(x, mode));
          }
        }
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Mar 04 20:15:57 UTC 2024
    - 32.5K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/math/LongMath.java

         *
         * The key idea is that based on the number of leading zeros (equivalently, floor(log2(x))), we
         * can narrow the possible floor(log10(x)) values to two. For example, if floor(log2(x)) is 6,
         * then 64 <= x < 128, so floor(log10(x)) is either 1 or 2.
         */
        int y = maxLog10ForLeadingZeros[Long.numberOfLeadingZeros(x)];
        /*
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 44.6K bytes
    - Viewed (0)
  3. guava/src/com/google/common/math/LongMath.java

         *
         * The key idea is that based on the number of leading zeros (equivalently, floor(log2(x))), we
         * can narrow the possible floor(log10(x)) values to two. For example, if floor(log2(x)) is 6,
         * then 64 <= x < 128, so floor(log10(x)) is either 1 or 2.
         */
        int y = maxLog10ForLeadingZeros[Long.numberOfLeadingZeros(x)];
        /*
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 44.6K bytes
    - Viewed (0)
  4. src/math/big/natconv.go

    		var r nat
    		index := len(table) - 1
    		for len(q) > leafSize {
    			// find divisor close to sqrt(q) if possible, but in any case < q
    			maxLength := q.bitLen()     // ~= log2 q, or at of least largest possible q of this bit length
    			minLength := maxLength >> 1 // ~= log2 sqrt(q)
    			for index > 0 && table[index-1].nbits > minLength {
    				index-- // desired
    			}
    			if table[index].nbits >= maxLength && table[index].bbb.cmp(q) >= 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 18 17:59:44 UTC 2022
    - 14.6K bytes
    - Viewed (0)
  5. src/image/gif/writer.go

    	"image/draw"
    	"internal/byteorder"
    	"io"
    )
    
    // Graphic control extension fields.
    const (
    	gcLabel     = 0xF9
    	gcBlockSize = 0x04
    )
    
    var log2Lookup = [8]int{2, 4, 8, 16, 32, 64, 128, 256}
    
    func log2(x int) int {
    	for i, v := range log2Lookup {
    		if x <= v {
    			return i
    		}
    	}
    	return -1
    }
    
    // writer is a buffered writer.
    type writer interface {
    	Flush() error
    	io.Writer
    	io.ByteWriter
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:38:09 UTC 2024
    - 11.9K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/ssa/magic.go

    // Rearranging,
    //   2^e > x * delta * c
    // x can be at most 2^n-1 and delta can be at most 1.
    // So it is sufficient to have 2^e >= 2^n*c.
    // So we'll choose e = n + s, with s = ⎡log2(c)⎤.
    //
    // An additional complication arises because m has n+1 bits in it.
    // Hardware restricts us to n bit by n bit multiplies.
    // We divide into 3 cases:
    //
    // Case 1: m is even.
    //   ⎣x / c⎦ = ⎣x * m / 2^(n+s)⎦
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:25 UTC 2024
    - 15.8K bytes
    - Viewed (0)
  7. src/internal/trace/summary_test.go

    				// which makes regenerating this test very annoying, since it will
    				// likely break this test. Resolve this by making the order not matter.
    				{Task: 12, Category: "log2", Message: "do"},
    				{Task: 12, Category: "log", Message: "fanout region4"},
    				{Task: 12, Category: "log", Message: "fanout region0"},
    				{Task: 12, Category: "log", Message: "fanout region1"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 13.4K bytes
    - Viewed (0)
  8. src/strconv/ftoa.go

    	// at most 2^(exp-mantbits).
    	//
    	// So the number is already shortest if 10^(dp-nd) > 2^(exp-mantbits),
    	// or equivalently log2(10)*(dp-nd) > exp-mantbits.
    	// It is true if 332/100*(dp-nd) >= exp-mantbits (log2(10) > 3.32).
    	minexp := flt.bias + 1 // minimum possible exponent
    	if exp > minexp && 332*(d.dp-d.nd) >= 100*(exp-int(flt.mantbits)) {
    		// The number is already shortest.
    		return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:21:28 UTC 2024
    - 13.9K bytes
    - Viewed (0)
  9. guava/src/com/google/common/collect/TopKSelector.java

        int minThresholdPosition = 0;
        // The leftmost position at which the greatest of the k lower elements
        // -- the new value of threshold -- might be found.
    
        int iterations = 0;
        int maxIterations = IntMath.log2(right - left, RoundingMode.CEILING) * 3;
        while (left < right) {
          int pivotIndex = (left + right + 1) >>> 1;
    
          int pivotNewIndex = partition(left, right, pivotIndex);
    
          if (pivotNewIndex > k) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/TopKSelector.java

        int minThresholdPosition = 0;
        // The leftmost position at which the greatest of the k lower elements
        // -- the new value of threshold -- might be found.
    
        int iterations = 0;
        int maxIterations = IntMath.log2(right - left, RoundingMode.CEILING) * 3;
        while (left < right) {
          int pivotIndex = (left + right + 1) >>> 1;
    
          int pivotNewIndex = partition(left, right, pivotIndex);
    
          if (pivotNewIndex > k) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 11.2K bytes
    - Viewed (0)
Back to top