2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-25 22:38:04 +02:00
This commit is contained in:
Martin Thoma 2014-02-02 13:49:19 +01:00
parent e7e4f64df5
commit f93467bad7
5 changed files with 11 additions and 4 deletions

View file

@ -1,9 +1,12 @@
$ ghci binomialkoeffizient.hs
GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help
GHCi, version 7.4.2:
http://www.haskell.org/ghc/
:? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main ( binomialkoeffizient.hs, interpreted )
[1 of 1] Compiling Main
( binomialkoeffizient.hs, interpreted )
Ok, modules loaded: Main.
*Main> binom 5 2
10

View file

@ -1,2 +1,4 @@
fakAcc n acc = if (n==0) then acc else fakAcc (n-1) (n*acc)
fakAcc n acc = if (n==0)
then acc
else fakAcc (n-1) (n*acc)
fak n = fakAcc n 1