Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for numberOfTrailingZeros (0.27 sec)

  1. android/guava/src/com/google/common/math/BigIntegerMath.java

        int startingNumber = LongMath.factorials.length;
        long product = LongMath.factorials[startingNumber - 1];
        // Strip off 2s from this value.
        int shift = Long.numberOfTrailingZeros(product);
        product >>= shift;
    
        // Use floor(log2(num)) + 1 to prevent overflow of multiplication.
        int productBits = LongMath.log2(product, FLOOR) + 1;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 18.9K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/math/IntMath.java

         * >40% faster than the Euclidean algorithm in benchmarks.
         */
        int aTwos = Integer.numberOfTrailingZeros(a);
        a >>= aTwos; // divide out all 2s
        int bTwos = Integer.numberOfTrailingZeros(b);
        b >>= bTwos; // divide out all 2s
        while (a != b) { // both a, b are odd
          // The key to the binary GCD algorithm is as follows:
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 23.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/primitives/UnsignedBytes.java

                 * little-endian. Long.numberOfTrailingZeros(diff) tells us the least significant
                 * nonzero bit, and zeroing out the first three bits of L.nTZ gives us the shift to get
                 * that least significant nonzero byte.
                 */
                int n = Long.numberOfTrailingZeros(lw ^ rw) & ~0x7;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 18.3K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/math/LongMath.java

         * >60% faster than the Euclidean algorithm in benchmarks.
         */
        int aTwos = Long.numberOfTrailingZeros(a);
        a >>= aTwos; // divide out all 2s
        int bTwos = Long.numberOfTrailingZeros(b);
        b >>= bTwos; // divide out all 2s
        while (a != b) { // both a, b are odd
          // The key to the binary GCD algorithm is as follows:
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 44.6K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/primitives/UnsignedLongs.java

        } else {
          char[] buf = new char[64];
          int i = buf.length;
          if ((radix & (radix - 1)) == 0) {
            // Radix is a power of two so we can avoid division.
            int shift = Integer.numberOfTrailingZeros(radix);
            int mask = radix - 1;
            do {
              buf[--i] = Character.forDigit(((int) x) & mask, radix);
              x >>>= shift;
            } while (x != 0);
          } else {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 17.6K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/math/DoubleMath.java

      public static boolean isMathematicalInteger(double x) {
        return isFinite(x)
            && (x == 0.0
                || SIGNIFICAND_BITS - Long.numberOfTrailingZeros(getSignificand(x)) <= getExponent(x));
      }
    
      /**
       * Returns {@code n!}, that is, the product of the first {@code n} positive integers, {@code 1} if
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 18.9K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/io/BaseEncoding.java

          // The logic here would be wrong for bitsPerChar > 8, but since we require distinct ASCII
          // characters that can't happen.
          int zeroesInBitsPerChar = Integer.numberOfTrailingZeros(bitsPerChar);
          this.charsPerChunk = 1 << (3 - zeroesInBitsPerChar);
          this.bytesPerChunk = bitsPerChar >> zeroesInBitsPerChar;
    
          this.mask = chars.length - 1;
    
          this.decodabet = decodabet;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Mar 15 16:33:32 GMT 2024
    - 41.7K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/Sets.java

            @Override
            public boolean hasNext() {
              return remainingSetBits != 0;
            }
    
            @Override
            public E next() {
              int index = Integer.numberOfTrailingZeros(remainingSetBits);
              if (index == 32) {
                throw new NoSuchElementException();
              }
              remainingSetBits &= ~(1 << index);
              return elements.get(index);
            }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 77.2K bytes
    - Viewed (0)
Back to top