Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for BitLength (0.22 sec)

  1. src/compress/flate/huffman_code.go

    		return s[i].literal < s[j].literal
    	}
    	return s[i].freq < s[j].freq
    }
    
    func (s byFreq) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
    
    func reverseBits(number uint16, bitLength byte) uint16 {
    	return bits.Reverse16(number << (16 - bitLength))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 18 17:59:44 UTC 2022
    - 9.7K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/math/BigIntegerMath.java

      }
    
      /** Returns {@code true} if {@code x} represents a power of two. */
      public static boolean isPowerOfTwo(BigInteger x) {
        checkNotNull(x);
        return x.signum() > 0 && x.getLowestSetBit() == x.bitLength() - 1;
      }
    
      /**
       * Returns the base-2 logarithm of {@code x}, rounded according to the specified rounding mode.
       *
       * @throws IllegalArgumentException if {@code x <= 0}
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 18.9K bytes
    - Viewed (0)
  3. src/compress/flate/huffman_bit_writer.go

    		numCodegens--
    	}
    	header := 3 + 5 + 5 + 4 + (3 * numCodegens) +
    		w.codegenEncoding.bitLength(w.codegenFreq[:]) +
    		int(w.codegenFreq[16])*2 +
    		int(w.codegenFreq[17])*3 +
    		int(w.codegenFreq[18])*7
    	size = header +
    		litEnc.bitLength(w.literalFreq) +
    		offEnc.bitLength(w.offsetFreq) +
    		extraBits
    
    	return size, numCodegens
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 29 22:59:14 UTC 2022
    - 18.4K bytes
    - Viewed (0)
  4. guava/src/com/google/common/math/BigIntegerMath.java

      }
    
      /** Returns {@code true} if {@code x} represents a power of two. */
      public static boolean isPowerOfTwo(BigInteger x) {
        checkNotNull(x);
        return x.signum() > 0 && x.getLowestSetBit() == x.bitLength() - 1;
      }
    
      /**
       * Returns the base-2 logarithm of {@code x}, rounded according to the specified rounding mode.
       *
       * @throws IllegalArgumentException if {@code x <= 0}
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 18.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/math/DoubleUtils.java

      }
    
      static double bigToDouble(BigInteger x) {
        // This is an extremely fast implementation of BigInteger.doubleValue(). JDK patch pending.
        BigInteger absX = x.abs();
        int exponent = absX.bitLength() - 1;
        // exponent == floor(log2(abs(x)))
        if (exponent < Long.SIZE - 1) {
          return x.longValue();
        } else if (exponent > MAX_EXPONENT) {
          return x.signum() * POSITIVE_INFINITY;
        }
    
        /*
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Apr 28 15:37:52 UTC 2021
    - 5.1K bytes
    - Viewed (0)
  6. src/encoding/asn1/asn1_test.go

    			t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok)
    		}
    		if err == nil {
    			if test.bitLength != ret.BitLength || !bytes.Equal(ret.Bytes, test.out) {
    				t.Errorf("#%d: Bad result: %v (expected %v %v)", i, ret, test.out, test.bitLength)
    			}
    		}
    	}
    }
    
    func TestBitStringAt(t *testing.T) {
    	bs := BitString{[]byte{0x82, 0x40}, 16}
    	if bs.At(0) != 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 29 18:24:36 UTC 2023
    - 43.6K bytes
    - Viewed (0)
  7. guava/src/com/google/common/math/DoubleUtils.java

      }
    
      static double bigToDouble(BigInteger x) {
        // This is an extremely fast implementation of BigInteger.doubleValue(). JDK patch pending.
        BigInteger absX = x.abs();
        int exponent = absX.bitLength() - 1;
        // exponent == floor(log2(abs(x)))
        if (exponent < Long.SIZE - 1) {
          return x.longValue();
        } else if (exponent > MAX_EXPONENT) {
          return x.signum() * POSITIVE_INFINITY;
        }
    
        /*
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Apr 28 15:37:52 UTC 2021
    - 5.1K bytes
    - Viewed (0)
  8. src/encoding/asn1/asn1.go

    // valid bits is recorded. Padding bits will be zero.
    type BitString struct {
    	Bytes     []byte // bits packed into bytes.
    	BitLength int    // length in bits.
    }
    
    // At returns the bit at the given index. If the index is out of range it
    // returns 0.
    func (b BitString) At(i int) int {
    	if i < 0 || i >= b.BitLength {
    		return 0
    	}
    	x := i / 8
    	y := 7 - uint(i%8)
    	return int(b.Bytes[x]>>y) & 1
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 31.8K bytes
    - Viewed (0)
  9. src/crypto/x509/x509.go

    		return nil, err
    	}
    
    	pkix := pkixPublicKey{
    		Algo: publicKeyAlgorithm,
    		BitString: asn1.BitString{
    			Bytes:     publicKeyBytes,
    			BitLength: 8 * len(publicKeyBytes),
    		},
    	}
    
    	ret, _ := asn1.Marshal(pkix)
    	return ret, nil
    }
    
    // These structures reflect the ASN.1 structure of X.509 certificates.:
    
    type certificate struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 09:20:15 UTC 2024
    - 82K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/primitives/UnsignedInteger.java

       */
      public static UnsignedInteger valueOf(BigInteger value) {
        checkNotNull(value);
        checkArgument(
            value.signum() >= 0 && value.bitLength() <= Integer.SIZE,
            "value (%s) is outside the range for an unsigned integer value",
            value);
        return fromIntBits(value.intValue());
      }
    
      /**
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 23 18:45:50 UTC 2023
    - 8.3K bytes
    - Viewed (0)
Back to top