I tried with BigIntegerfor operations with large numbers, but I see that the product operation is very slow when I calculate the combinations of CnR and factorials.
BigInteger n = BigInteger.ONE;
for (int i=1; i<=20; i++) {
n = n.multiply(BigInteger.valueOf(i));
}
I am looking for a better algorithm, including ints arrays.
Paul source
share