8 lines
169 B
Plaintext
8 lines
169 B
Plaintext
/// This function computes the n-th value of the fibbonacci sequence.
|
|
fn fib(n: u64): u64 {
|
|
if n < 2 {
|
|
return n;
|
|
}
|
|
|
|
return fib(n - 1) + fib(n - 2);
|
|
} |