[−]Trait game24::traits::Factorial
Unary operator for computing the factorial of a number
Implements checked and unchecked versions of the formula
Required methods
fn checked_factorial(&self) -> Option<Target>
Returns self!
, i.e. the factorial of self
,
if it doesn't overflow the type T
.
Examples
use factorial::Factorial; assert_eq!(10u32.checked_factorial(), Some(3628800));
Provided methods
fn factorial(&self) -> Target
Returns self!
, i.e. the factorial of self
.
Examples
use factorial::Factorial; assert_eq!(10u32.factorial(), 3628800);
Implementors
impl Factorial<Maybe32> for Maybe32
[src]
fn checked_factorial(&self) -> Option<Maybe32>
[src]
impl<T> Factorial<T> for T where
T: PartialOrd<T> + CheckedMul + Unsigned,
T: PartialOrd<T> + CheckedMul + Unsigned,