pub fn binom<T>(n: &Ratio<T>, k: i64) -> Result<Ratio<T>, Error>Expand description
The binomial coefficient C(n, k) for a rational n and a whole k, with J’s extension to negative k. For a whole n from 0, a k above n gives 0. A negative k gives 0, unless n is a whole number with k ≤ n < 0, where the result is (-1)^(n-k) C(-k-1, n-k). Otherwise the result is the product of (n-i)/(i+1) for each i from 0 below k. It checks for an interrupt once every 1,024 steps of that product.