Posted By

aflatter on 02/03/09


Tagged

numbers recursive fibonacci haskell


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

keigoi


Fibonacci Numbers in Haskell


 / Published in: Other
 

  1. fib 0 = (1,0)
  2. fib n = (a+b,a)
  3. where (a,b) = fib (n-1)
  4.  
  5. fibo n = a where (a,b) = fib n

Report this snippet  

You need to login to post a comment.