direct_binomial

Function direct_binomial 

Source
unsafe fn direct_binomial(p: ValidPrime, n: usize, k: usize) -> u32
Expand description

This uses a lookup table for n choose k when n and k are both less than p. Lucas’s theorem reduces general binomial coefficients to this case.

Calling this function safely requires that k, n < p. These invariants are often known apriori because k and n are obtained by reducing mod p, so it is better to expose an unsafe interface that avoids these checks.