- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 27 for factorial (0.23 sec)
-
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) -
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) -
android/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.
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) -
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) -
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() {
Java - Registered: Fri Apr 12 12:43:09 GMT 2024 - Last Modified: Wed Feb 07 17:50:39 GMT 2024 - 24.5K 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) -
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() {
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Wed Feb 07 17:50:39 GMT 2024 - 24.5K bytes - Viewed (0) -
android/guava/src/com/google/common/math/DoubleMath.java
* Double.MAX_VALUE}. * * <p>The result is within 1 ulp of the true value. * * @throws IllegalArgumentException if {@code n < 0} */ public static double factorial(int n) { checkNonNegative("n", n); if (n > MAX_FACTORIAL) { return Double.POSITIVE_INFINITY; } else { // Multiplying the last (n & 0xf) values into their own accumulator gives a more accurate
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)