You are viewing a single comment's thread. Return to all comments →
fibh :: Int -> Int -> Int -> Int fibh 1 a b = a+b fibh n a b = fibh (n-1) b (a+b) fib 1 = 0 fib 2 = 1 fib n = fibh (n-2) 0 1
i feel dirty for using recursion like this, but the runtime should be fine...
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci Numbers
You are viewing a single comment's thread. Return to all comments →
i feel dirty for using recursion like this, but the runtime should be fine...