home *** CD-ROM | disk | FTP | other *** search
-
- (*********************************************************************
-
- Adapted from
- Roman E. Maeder: Programming in Mathematica,
- Second Edition, Addison-Wesley, 1991.
-
- *********************************************************************)
-
-
- Fibonacci::usage = "Fibonacci[n] computes the n-th Fibonacci number."
-
- Fibonacci[n_Integer?Positive] :=
- Module[{fn1=1, fn2=0},
- Do[ {fn1, fn2} = {fn1 + fn2, fn1}, {n-1} ];
- fn1
- ]
-