Press CTRL+C or CMD+C to copy the selected text and close this dialog.
Tweet
0 people like it. Like the snippet!
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
let fib n = match n with | 1 -> 1 | 2 -> 1 | _ when n <= 1 -> 0 | _ -> let rec iter a b i = if i=n then a+b else iter b (a+b) (i+1) in iter 1 1 3