Factorial: Difference between revisions
→{{header|Coq}}: Added Coq example
m (Solve bug for 0!) |
(→{{header|Coq}}: Added Coq example) |
||
Line 3,408:
x: 5</syntaxhighlight>
=={{header|Coq}}==
<syntaxhighlight lang="coq">
Fixpoint factorial (n : nat) : nat :=
match n with
| 0 => 1
| S k => (S k) * (factorial k)
end.
</syntaxhighlight>
=={{header|Crystal}}==
|