Skip to content

Commit 04c30a1

Browse files
authored
Update Fibonacci.fs (#20)
added a function to get the nth Fibonacci number
1 parent 3aac1b0 commit 04c30a1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Algorithms/Math/Fibonacci.fs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ module Fibonacci =
44
let rec PrintSerie (one: int) (two: int) =
55
let fibo = one + two
66
System.Console.WriteLine fibo
7-
PrintSerie two fibo
7+
PrintSerie two fibo
8+
9+
let rec NthFibonacci (n: int): int =
10+
match n with
11+
| 0 -> 0
12+
| 1 -> 1
13+
| n -> NthFibonacci (n-1) + NthFibonacci (n-2)

0 commit comments

Comments
 (0)