Greg Buchholz wrote:
Integral division is spelled "div"...
Thanks, that worked.
The "course material" on the website uses a "/". See the second link
from the top, English notes. On page 5, right at the bottom. This course
material teaches "Gofer" which it claims is "essentially a subset o
Daniel Carrera wrote:
>
> Playing around with Haskell... I'm writing a 'choose' function:
> --//--
> fac :: Int -> Int
> fac 0 = 1
> fac n = n*fac(n-1)
>
> choose :: Int -> Int -> Int
> choose n k = fac(n) / (fac(k) * fac(n-k))
> --//--
>
> I'm having problems with the last line.
>
Integral
Hello all,
Playing around with Haskell... I'm writing a 'choose' function:
--//--
fac :: Int -> Int
fac 0 = 1
fac n = n*fac(n-1)
choose :: Int -> Int -> Int
choose n k = fac(n) / (fac(k) * fac(n-k))
--//--
I'm having problems with the last line.
--//--
Prelude> :l test.hs
Compiling Main