2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-25 14:28:05 +02:00
LaTeX-examples/documents/Programmierparadigmen/scripts/haskell/binomialkoeffizient-guard.hs

5 lines
168 B
Haskell
Raw Normal View History

2014-02-24 11:44:57 +01:00
binom :: (Eq a, Num a, Num a1) => a -> a -> a1
binom n k
| (k==0) || (k==n) = 1
| otherwise = binom (n-1) (k-1)
+ binom (n-1) k