sample-code/fib.cl: rename fib-iterative -> fibit (easier to type)

This commit is contained in:
John 2024-07-26 06:13:59 -05:00
parent 3aef055739
commit 872818fe7c

View File

@ -2,7 +2,7 @@
fn main() { fn main() {
for num in 0..=30 { for num in 0..=30 {
println("fib(", num, ") = ", fib_iterative(num)) println("fib(", num, ") = ", fibit(num))
} }
for num in 0..=30 { for num in 0..=30 {
println("fib(", num, ") = ", fib(num)) println("fib(", num, ") = ", fib(num))
@ -17,7 +17,7 @@ fn fib(a: i64) -> i64 {
} }
/// The classic iterative algorithm for fib() /// The classic iterative algorithm for fib()
fn fib_iterative(n: i64) -> i64 { fn fibit(n: i64) -> i64 {
let mut a = 0; let mut a = 0;
let mut b = 1; let mut b = 1;
let mut c = 1; let mut c = 1;