Skip to main content

Crate math

Crate math 

Source
Expand description

Precomputed modular binomial coefficients: nCr mod p.

ModBinomial::new builds factorials and inverse factorials up to max_n in O(max_n) time using Fermat’s little theorem for the modular inverse (modulo must be prime). Each subsequent ModBinomial::ncr call is O(1).

Structs§

ModBinomial
Binomial-coefficient table modulo a prime modulo.