On 3/31/07, Scott Brown <[EMAIL PROTECTED]> wrote:

It's working now, thank you.
I changed the definition to

> binom n j = div (fac n) ((fac j)*(fac (n - j)))

> bernoulli n p j = fromIntegral(binom n j)*(p ^ j) * ((1 - p)^(n - j))

As a matter of style suggestion, it might make 'binom' more clear if
you use 'div' as an infix operator:

binom n j = (fac n) `div` ( fac j * fac (n - j) )
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to