Skip to main content
Log in

Mojo function

factorial

factorial(n: Int) -> Int

Computes the factorial of the integer.

Args:

  • n (Int): The input value. Must be non-negative.

Returns:

The factorial of the input. Results are undefined for negative inputs.