|
|
|
|
|
by kccqzy
540 days ago
|
|
You should see the Mathematica version: fibonacci[0] = 0;
fibonacci[1] = 1;
fibonacci[n_] := fibonacci[n] = fibonacci[n-1] + fibonacci[n-2]
It cleverly uses both = and := together. Usually people use = for immediate assignment (such as constants) and := for delayed assignment (such as functions) but this combines the two. |
|