2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00
LaTeX-examples/documents/Programmierparadigmen/scripts/haskell/binomialkoeffizient.hs

6 lines
137 B
Haskell
Raw Normal View History

binom :: (Eq a, Num a, Num a1) => a -> a -> a1
2014-02-01 15:32:13 +01:00
binom n k =
if (k==0) || (k==n)
then 1
else binom (n-1) (k-1) + binom (n-1) k