Created
July 2, 2024 14:34
-
-
Save espio999/00f3f0e2e256c794e4d5555682fe04e5 to your computer and use it in GitHub Desktop.
F# fibonacci
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec fib n = | |
match n with | |
| 0 | 1 -> n | |
| n -> fib (n-1) + fib (n-2) | |
fib 40 |> printfn "%A" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment