sanjeeb-talukdar / combinatoricslib

Automatically exported from code.google.com/p/combinatoricslib
0 stars 0 forks source link

factorial function should change #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 reported on code.google.com by xuhengb...@gmail.com on 13 Mar 2014 at 3:05

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Scheduled for the release 2.2

Original comment by d.pau...@gmail.com on 19 Jun 2014 at 4:35