You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static BigDecimal factorial(long x) {
BigDecimal result = BigDecimal.valueOf(1);
for (long i = 2; i <= x; i++) {
result=result.multiply(BigDecimal.valueOf(i));
}
return result;
}
becos is x is big enough,result will bigger than Long.maxVal()
From [email protected] on March 13, 2014 05:05:11
factorial must change to ==>
public static BigDecimal factorial(long x) {
BigDecimal result = BigDecimal.valueOf(1);
for (long i = 2; i <= x; i++) {
result=result.multiply(BigDecimal.valueOf(i));
}
return result;
}
becos is x is big enough,result will bigger than Long.maxVal()
Original issue: http://code.google.com/p/combinatoricslib/issues/detail?id=10
The text was updated successfully, but these errors were encountered: