Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 64 for factories (0.18 seconds)

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

          binomials[i] = RANDOM_SOURCE.nextInt(factorials[i] + 1);
        }
      }
    
      /** Previous version of BigIntegerMath.factorial, kept for timing purposes. */
      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));
        }
      }
    
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Dec 19 18:03:30 GMT 2024
    - 3.5K bytes
    - Click Count (0)
  2. guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java

          binomials[i] = RANDOM_SOURCE.nextInt(factorials[i] + 1);
        }
      }
    
      /** Previous version of BigIntegerMath.factorial, kept for timing purposes. */
      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));
        }
      }
    
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Dec 19 18:03:30 GMT 2024
    - 3.5K bytes
    - Click Count (0)
  3. android/guava-tests/benchmark/com/google/common/math/DoubleMathBenchmark.java

          tmp += Double.doubleToRawLongBits(DoubleMath.log2(positiveDoubles[j]));
        }
        return tmp;
      }
    
      @Benchmark
      long factorial(int reps) {
        long tmp = 0;
        for (int i = 0; i < reps; i++) {
          int j = i & ARRAY_MASK;
          tmp += Double.doubleToRawLongBits(DoubleMath.factorial(factorials[j]));
        }
        return tmp;
      }
    
      @Benchmark
      int isMathematicalInteger(int reps) {
        int tmp = 0;
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Dec 19 18:03:30 GMT 2024
    - 2.6K bytes
    - Click Count (0)
  4. guava/src/com/google/common/math/BigIntegerMath.java

       * <p>This uses an efficient binary recursive algorithm to compute the factorial with balanced
       * multiplies. It also removes all the 2s from the intermediate products (shifting them back in at
       * the end).
       *
       * @throws IllegalArgumentException if {@code n < 0}
       */
      public static BigInteger factorial(int n) {
        checkNonNegative("n", n);
    
        // If the factorial is small enough, just use LongMath to do it.
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Aug 07 16:05:33 GMT 2025
    - 18.8K bytes
    - Click Count (0)
  5. android/guava-tests/benchmark/com/google/common/math/ApacheBenchmark.java

     *
     * @author Louis Wasserman
     */
    @NullUnmarked
    public class ApacheBenchmark {
      private enum Impl {
        GUAVA {
          @Override
          public double factorialDouble(int n) {
            return DoubleMath.factorial(n);
          }
    
          @Override
          public int gcdInt(int a, int b) {
            return IntMath.gcd(a, b);
          }
    
          @Override
          public long gcdLong(long a, long b) {
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Mon Jul 14 14:44:08 GMT 2025
    - 6.9K bytes
    - Click Count (0)
  6. compat/maven-compat/src/main/java/org/apache/maven/toolchain/ToolchainManagerFactory.java

                }
            };
        }
    
        private org.apache.maven.impl.DefaultToolchainManager getDelegate() {
            Map<String, ToolchainFactory> v3Factories = lookup.lookupMap(ToolchainFactory.class);
            Map<String, org.apache.maven.api.services.ToolchainFactory> v4Factories =
                    lookup.lookupMap(org.apache.maven.api.services.ToolchainFactory.class);
    Created: Sun Dec 28 03:35:09 GMT 2025
    - Last Modified: Fri Oct 31 10:58:52 GMT 2025
    - 11K bytes
    - Click Count (0)
  7. guava/src/com/google/common/math/LongMath.java

       *
       * @throws IllegalArgumentException if {@code n < 0}
       */
      @GwtIncompatible // TODO
      public static long factorial(int n) {
        checkNonNegative("n", n);
        return (n < factorials.length) ? factorials[n] : Long.MAX_VALUE;
      }
    
      static final long[] factorials = {
        1L,
        1L,
        1L * 2,
        1L * 2 * 3,
        1L * 2 * 3 * 4,
        1L * 2 * 3 * 4 * 5,
        1L * 2 * 3 * 4 * 5 * 6,
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Mon Nov 03 21:01:09 GMT 2025
    - 46.8K bytes
    - Click Count (0)
  8. android/guava-tests/test/com/google/common/math/DoubleMathTest.java

          double actual = BigIntegerMath.factorial(i).doubleValue();
          double result = DoubleMath.factorial(i);
          assertThat(result).isWithin(Math.ulp(actual)).of(actual);
        }
      }
    
      public void testFactorialTooHigh() {
        assertThat(DoubleMath.factorial(DoubleMath.MAX_FACTORIAL + 1)).isPositiveInfinity();
        assertThat(DoubleMath.factorial(DoubleMath.MAX_FACTORIAL + 20)).isPositiveInfinity();
      }
    
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Oct 30 14:15:36 GMT 2025
    - 27.3K bytes
    - Click Count (0)
  9. guava-tests/test/com/google/common/math/BigIntegerMathTest.java

      }
    
      // Depends on the correctness of BigIntegerMath.factorial
      private static void runBinomialTest(int firstN, int lastN) {
        for (int n = firstN; n <= lastN; n++) {
          for (int k = 0; k <= n; k++) {
            BigInteger expected =
                BigIntegerMath.factorial(n)
                    .divide(BigIntegerMath.factorial(k))
                    .divide(BigIntegerMath.factorial(n - k));
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Wed Nov 19 01:35:24 GMT 2025
    - 27.1K bytes
    - Click Count (0)
  10. guava-tests/test/com/google/common/math/DoubleMathTest.java

          double actual = BigIntegerMath.factorial(i).doubleValue();
          double result = DoubleMath.factorial(i);
          assertThat(result).isWithin(Math.ulp(actual)).of(actual);
        }
      }
    
      public void testFactorialTooHigh() {
        assertThat(DoubleMath.factorial(DoubleMath.MAX_FACTORIAL + 1)).isPositiveInfinity();
        assertThat(DoubleMath.factorial(DoubleMath.MAX_FACTORIAL + 20)).isPositiveInfinity();
      }
    
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Oct 30 14:15:36 GMT 2025
    - 27.3K bytes
    - Click Count (0)
Back to Top