pub const fn div_factorials(x: usize, y: usize) -> usize
Expand description

Calculates the division of two factorials of the form n! ÷ (n - k)!.

Arguments

  • x: usize - n.
  • y: usize - n - k.

Returns

A usize.

Examples

use lib_rapid::math::general::div_factorials;
 
assert_eq!(div_factorials(245, 242), 14526540); // 245! ÷ 242! = 245 · 244 · 243.
assert_eq!(div_factorials(1, 0), 1); // 1! ÷ 0! = 1 ÷ 1.