Struct nekolib::math::ModFactorialBinom
source · pub struct ModFactorialBinom { /* private fields */ }
Expand description
法 $p$ での二項係数。
Examples
use nekolib::math::ModFactorialBinom;
const MOD: u64 = 998244353;
let mfb = ModFactorialBinom::new(10, MOD);
assert_eq!(mfb.factorial(5), 120);
assert_eq!(mfb.factorial_recip(5), 856826403);
assert_eq!(mfb.recip(3), 332748118);
assert_eq!(mfb.perm(6, 4), 360);
assert_eq!(mfb.binom(7, 3), 35);
ⓘ
use nekolib::math::ModFactorialBinom;
const MOD: u64 = 998244353;
let mfb = ModFactorialBinom::new(10, MOD);
mfb.recip(0);
Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ModFactorialBinom
impl Send for ModFactorialBinom
impl Sync for ModFactorialBinom
impl Unpin for ModFactorialBinom
impl UnwindSafe for ModFactorialBinom
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more