mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 00:00:03 +03:00
Explain what a factorial is and link to wikipedia for more details
This commit is contained in:
parent
69021e1497
commit
01343f187b
|
@ -1,5 +1,8 @@
|
||||||
fn factorial(num: u64) -> u64 {
|
fn factorial(num: u64) -> u64 {
|
||||||
// TODO: Complete this function to return the factorial of `num`.
|
// TODO: Complete this function to return the factorial of `num` which is
|
||||||
|
// defined as `1 * 2 * 3 * … * num`.
|
||||||
|
// https://en.wikipedia.org/wiki/Factorial
|
||||||
|
//
|
||||||
// Do not use:
|
// Do not use:
|
||||||
// - early returns (using the `return` keyword explicitly)
|
// - early returns (using the `return` keyword explicitly)
|
||||||
// Try not to use:
|
// Try not to use:
|
||||||
|
|
Loading…
Reference in a new issue