# Script:Math:fib.scm

### From Gambit wiki

(Difference between revisions)

(Script:Math:fib.scm) |
|||

Line 1: | Line 1: | ||

- | <schemecode> | + | <schemecode>;; Math:fib.scm |

;; | ;; | ||

;; Author: Marc Feeley <feeley@iro.umontreal.ca> | ;; Author: Marc Feeley <feeley@iro.umontreal.ca> | ||

Line 8: | Line 8: | ||

(if (< n 2) | (if (< n 2) | ||

n | n | ||

- | (+ (fib (- n 1)) | + | (+ (fib (- n 1)) (fib (- n 2))))) |

- | + | ||

(repl-eval "(time (fib 25))\n")</schemecode> | (repl-eval "(time (fib 25))\n")</schemecode> |