Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for odd (0.19 sec)

  1. guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java

     * not wrapped in {@code ExecutionException}. For just a normal failure, use {@link
     * SettableFuture}).
     *
     * <p>Useful for testing the behavior of Future utilities against odd futures.
     *
     * @author Anthony Zana
     */
    @GwtCompatible
    final class UncheckedThrowingFuture<V> extends AbstractFuture<V> {
    
      public static <V> ListenableFuture<V> throwingError(Error error) {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 12 20:02:10 GMT 2018
    - 3.2K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/math/IntMath.java

        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:
          // Both a and b are odd. Assume a > b; then gcd(a - b, b) = gcd(a, b).
          // But in gcd(a - b, b), a - b is even and b is odd, so we can divide out powers of two.
    
          // We bend over backwards to avoid branching, adapting a technique from
    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. guava-tests/test/com/google/common/math/BigIntegerMathTest.java

        for (BigInteger x : POSITIVE_BIGINTEGER_CANDIDATES) {
          int halfEven = BigIntegerMath.log2(x, HALF_EVEN);
          // Now figure out what rounding mode we should behave like (it depends if FLOOR was
          // odd/even).
          boolean floorWasEven = (BigIntegerMath.log2(x, FLOOR) & 1) == 0;
          assertEquals(BigIntegerMath.log2(x, floorWasEven ? HALF_DOWN : HALF_UP), halfEven);
        }
      }
    
      @GwtIncompatible // TODO
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.2K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/math/BigIntegerMathTest.java

        for (BigInteger x : POSITIVE_BIGINTEGER_CANDIDATES) {
          int halfEven = BigIntegerMath.log2(x, HALF_EVEN);
          // Now figure out what rounding mode we should behave like (it depends if FLOOR was
          // odd/even).
          boolean floorWasEven = (BigIntegerMath.log2(x, FLOOR) & 1) == 0;
          assertEquals(BigIntegerMath.log2(x, floorWasEven ? HALF_DOWN : HALF_UP), halfEven);
        }
      }
    
      @GwtIncompatible // TODO
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 28.2K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/UncheckedThrowingFuture.java

     * not wrapped in {@code ExecutionException}. For just a normal failure, use {@link
     * SettableFuture}).
     *
     * <p>Useful for testing the behavior of Future utilities against odd futures.
     *
     * @author Anthony Zana
     */
    @GwtCompatible
    final class UncheckedThrowingFuture<V> extends AbstractFuture<V> {
    
      public static <V> ListenableFuture<V> throwingError(Error error) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 12 20:02:10 GMT 2018
    - 3.2K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/math/LongMath.java

        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:
          // Both a and b are odd. Assume a > b; then gcd(a - b, b) = gcd(a, b).
          // But in gcd(a - b, b), a - b is even and b is odd, so we can divide out powers of two.
    
          // We bend over backwards to avoid branching, adapting a technique from
    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)
  7. guava-tests/test/com/google/common/cache/CacheEvictionTest.java

      public void testEviction_maxWeight_zero() {
        CountingRemovalListener<Integer, Integer> removalListener = countingRemovalListener();
        IdentityLoader<Integer> loader = identityLoader();
    
        // Even numbers are free, odd are too expensive
        Weigher<Integer, Integer> evensOnly =
            new Weigher<Integer, Integer>() {
              @Override
              public int weigh(Integer k, Integer v) {
                return k % 2;
              }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 14.9K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/util/concurrent/AggregateFuture.java

         */
        if (throwable instanceof Error) {
          /*
           * TODO(cpovirk): Do we really want to log this if we called setException(throwable) and it
           * returned true? This was intentional (CL 46470009), but it seems odd compared to how we
           * normally handle Error.
           *
           * Similarly, do we really want to log the same Error more than once?
           */
          log(throwable);
        }
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 01 21:46:34 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/MinMaxPriorityQueue.java

      }
    
      private static final int EVEN_POWERS_OF_TWO = 0x55555555;
      private static final int ODD_POWERS_OF_TWO = 0xaaaaaaaa;
    
      @VisibleForTesting
      static boolean isEvenLevel(int index) {
        int oneBased = ~~(index + 1); // for GWT
        checkState(oneBased > 0, "negative index");
        return (oneBased & EVEN_POWERS_OF_TWO) > (oneBased & ODD_POWERS_OF_TWO);
      }
    
      /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 34K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/escape/Escapers.java

          return (UnicodeEscaper) escaper;
        } else if (escaper instanceof CharEscaper) {
          return wrap((CharEscaper) escaper);
        }
        // In practice this shouldn't happen because it would be very odd not to
        // extend either CharEscaper or UnicodeEscaper for non-trivial cases.
        throw new IllegalArgumentException(
            "Cannot create a UnicodeEscaper from: " + escaper.getClass().getName());
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 26 20:07:17 GMT 2023
    - 10.5K bytes
    - Viewed (0)
Back to top