Fibonacci Numbers in Haskell

/ Published in: Other
Save to your folder(s)

Copy this code and paste it in your HTML
  1. fib 0 = (1,0)
  2. fib n = (a+b,a)
  3. where (a,b) = fib (n-1)
  5. fibo n = a where (a,b) = fib n

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.