Skip to main content

factorial_checked

Function factorial_checked 

Source
pub fn factorial_checked<N: PrimInt + Unsigned>(n: N) -> Option<N>
Expand description

Factorial $n!$ with overflow checking

§Examples

assert_eq!(xsf::factorial_checked(12_u32), Some(479_001_600));
assert_eq!(xsf::factorial_checked(13_u32), None);

§See also