mscore::algorithm::isotope

Function factorial

Source
pub fn factorial(n: i32) -> f64
Expand description

calculate the factorial of a number

Arguments:

  • n - number to calculate factorial of

Returns:

  • f64 - factorial of n

ยงExamples

use mscore::algorithm::isotope::factorial;

let fact = factorial(5);
assert_eq!(fact, 120.0);