Skip to content

Commit ffa2077

Browse files
authored
Update recursive-functions-the-rec-keyword.md (dotnet#22565)
Typos in the code samples for non-recursive fibonacci.
1 parent 585a5e3 commit ffa2077

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/fsharp/language-reference/functions/recursive-functions-the-rec-keyword.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The following example shows a recursive function that computes the *n*<sup>th</s
3232
```fsharp
3333
let rec fib n =
3434
match n with
35-
| 0 | 1 -> 1
35+
| 0 | 1 -> n
3636
| n -> fib (n-1) + fib (n-2)
3737
```
3838

@@ -45,7 +45,7 @@ Methods are implicitly recursive within the type they are defined in, meaning th
4545
type MyClass() =
4646
member this.Fib(n) =
4747
match n with
48-
| 0 | 1 -> 1
48+
| 0 | 1 -> n
4949
| n -> this.Fib(n-1) + this.Fib(n-2)
5050
```
5151

0 commit comments

Comments
 (0)