- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 35 for factorials (0.18 sec)
-
android/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;
Java - Registered: Fri Apr 26 12:43:10 GMT 2024 - Last Modified: Wed Feb 07 17:50:39 GMT 2024 - 18.9K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/math/LongMathTest.java
public void testConstantsFactorials() { long expected = 1; for (int i = 0; i < LongMath.factorials.length; i++, expected *= i) { assertEquals(expected, LongMath.factorials[i]); } try { LongMath.checkedMultiply( LongMath.factorials[LongMath.factorials.length - 1], LongMath.factorials.length); fail("Expected ArithmeticException"); } catch (ArithmeticException expect) { }
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Mon Mar 04 20:15:57 GMT 2024 - 32.5K bytes - Viewed (0) -
guava-tests/test/com/google/common/math/LongMathTest.java
public void testConstantsFactorials() { long expected = 1; for (int i = 0; i < LongMath.factorials.length; i++, expected *= i) { assertEquals(expected, LongMath.factorials[i]); } try { LongMath.checkedMultiply( LongMath.factorials[LongMath.factorials.length - 1], LongMath.factorials.length); fail("Expected ArithmeticException"); } catch (ArithmeticException expect) { }
Java - Registered: Fri Apr 12 12:43:09 GMT 2024 - Last Modified: Mon Mar 04 20:15:57 GMT 2024 - 32.5K bytes - Viewed (0) -
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;
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) -
android/guava/src/com/google/common/math/IntMath.java
* * @throws IllegalArgumentException if {@code n < 0} */ public static int factorial(int n) { checkNonNegative("n", n); return (n < factorials.length) ? factorials[n] : Integer.MAX_VALUE; } private static final int[] factorials = { 1, 1, 1 * 2, 1 * 2 * 3, 1 * 2 * 3 * 4, 1 * 2 * 3 * 4 * 5, 1 * 2 * 3 * 4 * 5 * 6,
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) -
guava-tests/test/com/google/common/math/DoubleMathTest.java
assertTrue(BigIntegerMath.factorial(DoubleMath.MAX_FACTORIAL).compareTo(maxDoubleValue) <= 0); assertTrue( BigIntegerMath.factorial(DoubleMath.MAX_FACTORIAL + 1).compareTo(maxDoubleValue) > 0); } public void testConstantsEverySixteenthFactorial() { for (int i = 0, n = 0; n <= DoubleMath.MAX_FACTORIAL; i++, n += 16) { assertEquals(
Java - Registered: Fri Apr 12 12:43:09 GMT 2024 - Last Modified: Wed Feb 07 17:50:39 GMT 2024 - 28.1K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/math/DoubleMathTest.java
assertTrue(BigIntegerMath.factorial(DoubleMath.MAX_FACTORIAL).compareTo(maxDoubleValue) <= 0); assertTrue( BigIntegerMath.factorial(DoubleMath.MAX_FACTORIAL + 1).compareTo(maxDoubleValue) > 0); } public void testConstantsEverySixteenthFactorial() { for (int i = 0, n = 0; n <= DoubleMath.MAX_FACTORIAL; i++, n += 16) { assertEquals(
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Wed Feb 07 17:50:39 GMT 2024 - 28.1K bytes - Viewed (0) -
android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java
if (cls.isEnum()) { return; } List<? extends Invokable<?, ?>> factories = Lists.reverse(getFactories(TypeToken.of(cls))); if (factories.isEmpty()) { return; } int numberOfParameters = factories.get(0).getParameters().size(); List<ParameterNotInstantiableException> paramErrors = Lists.newArrayList();
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Thu Feb 08 17:31:55 GMT 2024 - 33K bytes - Viewed (0) -
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));
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) -
android/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));
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)