Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for LongMath (0.05 sec)

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

     * values, see {@link com.google.common.primitives.Longs}.
     *
     * @author Louis Wasserman
     * @since 11.0
     */
    @GwtCompatible(emulated = true)
    @ElementTypesAreNonnullByDefault
    public final class LongMath {
      @VisibleForTesting static final long MAX_SIGNED_POWER_OF_TWO = 1L << (Long.SIZE - 2);
    
      /**
       * Returns the smallest power of two greater than or equal to {@code x}. This is equivalent to
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  2. guava/src/com/google/common/math/LongMath.java

     * values, see {@link com.google.common.primitives.Longs}.
     *
     * @author Louis Wasserman
     * @since 11.0
     */
    @GwtCompatible(emulated = true)
    @ElementTypesAreNonnullByDefault
    public final class LongMath {
      @VisibleForTesting static final long MAX_SIGNED_POWER_OF_TWO = 1L << (Long.SIZE - 2);
    
      /**
       * Returns the smallest power of two greater than or equal to {@code x}. This is equivalent to
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/math/LongMathTest.java

        for (int i = 0; i < LongMath.powersOf10.length; i++) {
          assertEquals(LongMath.checkedPow(10, i), LongMath.powersOf10[i]);
        }
        assertThrows(
            ArithmeticException.class, () -> LongMath.checkedPow(10, LongMath.powersOf10.length));
      }
    
      @GwtIncompatible // TODO
      public void testConstantsHalfPowersOf10() {
        for (int i = 0; i < LongMath.halfPowersOf10.length; i++) {
          assertEquals(
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  4. 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;
        int bits = LongMath.log2(startingNumber, FLOOR) + 1;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 17:21:56 UTC 2024
    - 18.8K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/Streams.java

    import static java.lang.Math.min;
    import static java.util.Objects.requireNonNull;
    
    import com.google.common.annotations.Beta;
    import com.google.common.annotations.GwtCompatible;
    import com.google.common.math.LongMath;
    import com.google.errorprone.annotations.InlineMe;
    import com.google.errorprone.annotations.InlineMeValidationDisabled;
    import java.util.ArrayDeque;
    import java.util.Collection;
    import java.util.Deque;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 14:20:11 UTC 2024
    - 37.4K bytes
    - Viewed (0)
  6. guava/src/com/google/common/hash/BloomFilterStrategies.java

     * the License.
     */
    
    package com.google.common.hash;
    
    import static com.google.common.base.Preconditions.checkArgument;
    
    import com.google.common.math.LongMath;
    import com.google.common.primitives.Ints;
    import com.google.common.primitives.Longs;
    import java.math.RoundingMode;
    import java.util.Arrays;
    import java.util.concurrent.atomic.AtomicLongArray;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 10 19:45:10 UTC 2022
    - 10.7K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/math/IntMathTest.java

        for (int i = 0; i < 100000; i++) {
          assertEquals(LongMath.isPrime(i), IntMath.isPrime(i));
        }
    
        // Then check 1000 deterministic pseudo-random int values.
        Random rand = new Random(1);
        for (int i = 0; i < 1000; i++) {
          int n = rand.nextInt(Integer.MAX_VALUE);
          assertEquals(LongMath.isPrime(n), IntMath.isPrime(n));
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/math/IntMathTest.java

        for (int i = 0; i < 100000; i++) {
          assertEquals(LongMath.isPrime(i), IntMath.isPrime(i));
        }
    
        // Then check 1000 deterministic pseudo-random int values.
        Random rand = new Random(1);
        for (int i = 0; i < 1000; i++) {
          int n = rand.nextInt(Integer.MAX_VALUE);
          assertEquals(LongMath.isPrime(n), IntMath.isPrime(n));
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  9. guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java

    import static java.lang.Math.min;
    import static java.util.concurrent.TimeUnit.SECONDS;
    
    import com.google.common.annotations.GwtIncompatible;
    import com.google.common.annotations.J2ktIncompatible;
    import com.google.common.math.LongMath;
    import java.util.concurrent.TimeUnit;
    
    @J2ktIncompatible
    @GwtIncompatible
    @ElementTypesAreNonnullByDefault
    abstract class SmoothRateLimiter extends RateLimiter {
      /*
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Apr 04 09:45:04 UTC 2023
    - 19.3K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/cache/CacheStats.java

     * the License.
     */
    
    package com.google.common.cache;
    
    import static com.google.common.base.Preconditions.checkArgument;
    import static com.google.common.math.LongMath.saturatedAdd;
    import static com.google.common.math.LongMath.saturatedSubtract;
    import static java.lang.Math.max;
    
    import com.google.common.annotations.GwtCompatible;
    import com.google.common.base.MoreObjects;
    import com.google.common.base.Objects;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 12.6K bytes
    - Viewed (0)
Back to top