Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for factorials (0.07 sec)

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

          return BigInteger.valueOf(LongMath.factorials[n]);
        }
    
        // Pre-allocate space for our list of intermediate BigIntegers.
        int approxSize = IntMath.divide(n * IntMath.log2(n, CEILING), Long.SIZE, CEILING);
        ArrayList<BigInteger> bignums = new ArrayList<>(approxSize);
    
        // Start from the pre-computed maximum long factorial.
        int startingNumber = LongMath.factorials.length;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 17:21:56 UTC 2024
    - 18.8K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/math/LongMathTest.java

        long expected = 1;
        for (int i = 0; i < LongMath.factorials.length; i++, expected *= i) {
          assertEquals(expected, LongMath.factorials[i]);
        }
        assertThrows(
            ArithmeticException.class,
            () ->
                LongMath.checkedMultiply(
                    LongMath.factorials[LongMath.factorials.length - 1], LongMath.factorials.length));
      }
    
      @GwtIncompatible // TODO
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  3. guava/src/com/google/common/math/LongMath.java

        if (k > (n >> 1)) {
          k = n - k;
        }
        switch (k) {
          case 0:
            return 1;
          case 1:
            return n;
          default:
            if (n < factorials.length) {
              return factorials[n] / (factorials[k] * factorials[n - k]);
            } else if (k >= biggestBinomials.length || n > biggestBinomials[k]) {
              return Long.MAX_VALUE;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/math/LongMath.java

        if (k > (n >> 1)) {
          k = n - k;
        }
        switch (k) {
          case 0:
            return 1;
          case 1:
            return n;
          default:
            if (n < factorials.length) {
              return factorials[n] / (factorials[k] * factorials[n - k]);
            } else if (k >= biggestBinomials.length || n > biggestBinomials[k]) {
              return Long.MAX_VALUE;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 09 16:39:37 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  5. 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();
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 27.3K bytes
    - Viewed (0)
  6. 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();
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 27.3K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/math/IntMathTest.java

        }
      }
    
      // Depends on the correctness of BigIntegerMath.factorial.
      public void testFactorial() {
        for (int n = 0; n <= 50; n++) {
          BigInteger expectedBig = BigIntegerMath.factorial(n);
          int expectedInt = fitsInInt(expectedBig) ? expectedBig.intValue() : Integer.MAX_VALUE;
          assertEquals(expectedInt, IntMath.factorial(n));
        }
      }
    
      public void testFactorialNegative() {
    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/IntMathTest.java

        }
      }
    
      // Depends on the correctness of BigIntegerMath.factorial.
      public void testFactorial() {
        for (int n = 0; n <= 50; n++) {
          BigInteger expectedBig = BigIntegerMath.factorial(n);
          int expectedInt = fitsInInt(expectedBig) ? expectedBig.intValue() : Integer.MAX_VALUE;
          assertEquals(expectedInt, IntMath.factorial(n));
        }
      }
    
      public void testFactorialNegative() {
    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. tensorflow/c/eager/c_api_unified_experimental.cc

    namespace tensorflow {
    namespace tracing {
    typedef absl::flat_hash_map<std::string, tracing::FactoryFunction> FactoriesMap;
    
    static FactoriesMap& GetFactories() {
      static FactoriesMap* factories = new FactoriesMap;
      return *factories;
    }
    
    static tracing::FactoryFunction default_factory;
    
    void RegisterTracingEngineFactory(const string& name, FactoryFunction factory) {
      assert((!GetFactories().count(name)) ||
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 9K bytes
    - Viewed (0)
  10. guava/src/com/google/common/collect/TreeBasedTable.java

       * is returned.
       *
       * @deprecated Use {@code table.rowKeySet().comparator()} instead.
       */
      @Deprecated
      public Comparator<? super R> rowComparator() {
        /*
         * requireNonNull is safe because the factories require non-null Comparators, which they pass on
         * to the backing collections.
         */
        return requireNonNull(rowKeySet().comparator());
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 11.5K bytes
    - Viewed (0)
Back to top