Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 25 for LongMath (0.06 sec)

  1. guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java

      private static BigInteger oldSlowFactorial(int n) {
        if (n <= 20) {
          return BigInteger.valueOf(LongMath.factorial(n));
        } else {
          int k = 20;
          return BigInteger.valueOf(LongMath.factorial(k)).multiply(oldSlowFactorial(k, n));
        }
      }
    
      /** Returns the product of {@code n1} exclusive through {@code n2} inclusive. */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Aug 19 16:21:24 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  2. 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)
  3. android/guava-tests/test/com/google/common/math/MathBenchmarking.java

      static final int ARRAY_SIZE = 0x10000;
      static final int ARRAY_MASK = 0x0ffff;
      static final Random RANDOM_SOURCE = new Random(314159265358979L);
      static final int MAX_EXPONENT = 100;
    
      /*
       * Duplicated from LongMath.
       * binomial(biggestBinomials[k], k) fits in a long, but not
       * binomial(biggestBinomials[k] + 1, k).
       */
      static final int[] biggestBinomials = {
        Integer.MAX_VALUE,
        Integer.MAX_VALUE,
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 4.1K bytes
    - Viewed (0)
  4. guava-tests/benchmark/com/google/common/math/LessThanBenchmark.java

        int tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & SAMPLE_MASK;
          long x = xLongs[j];
          long y = yLongs[j];
          int z = constant[j];
          tmp += z + LongMath.lessThanBranchFree(x, y);
        }
        return tmp;
      }
    
      @Benchmark
      int ternaryLtLongAddOutsideTernary(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & SAMPLE_MASK;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 4K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. 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)
  8. guava-tests/test/com/google/common/math/MathBenchmarking.java

      static final int ARRAY_SIZE = 0x10000;
      static final int ARRAY_MASK = 0x0ffff;
      static final Random RANDOM_SOURCE = new Random(314159265358979L);
      static final int MAX_EXPONENT = 100;
    
      /*
       * Duplicated from LongMath.
       * binomial(biggestBinomials[k], k) fits in a long, but not
       * binomial(biggestBinomials[k] + 1, k).
       */
      static final int[] biggestBinomials = {
        Integer.MAX_VALUE,
        Integer.MAX_VALUE,
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 4.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