Closed GoogleCodeExporter closed 9 years ago
The current implementation is limited to a maximum initial parameter value of
12 (the max factorial that it can compute without overflowing).
I've added some error checking/reporting and slightly increased the dynamic
range (it'll go up to 20 now) as a stopgap, but it needs a new algorithm.
Something along the lines of
http://introcs.cs.princeton.edu/java/96optimization/Binomial.java.html
Original comment by tfmorris
on 12 Jan 2012 at 6:21
Fixed in r2459. Refine now knows that combin(60,6) is 50063860. It should
successfully compute any result which fits in a long. The upper limit is near
combin(66,33) = 7219428434016265740
The new limit is based on the size of the result, not solely the factorial of
the first parameter (which it never computes, because it's using a different
algorithm).
Original comment by tfmorris
on 8 Mar 2012 at 10:56
Original comment by tfmorris
on 18 Sep 2012 at 3:05
Original issue reported on code.google.com by
thadguidry
on 12 Jan 2012 at 2:34