Function lib_rapid::math::general::factorial

source ·
pub const fn factorial(n: u8) -> u128
Expand description

Calculates the factorial of a number.

Arguments

  • n: u8 - The number of which the factorial should be calculated.

Returns

A u128.

Examples

use lib_rapid::math::general::factorial;
 
assert_eq!(factorial(7), 7 * 6 * 5 * 4 * 3 * 2);