[erlang-questions] Frying pan bug

Vlad Dumitrescu vladdu55@REDACTED
Fri Mar 2 12:47:42 CET 2012


Hi Joe,

On Fri, Mar 2, 2012 at 12:42, Joe Armstrong <erlang@REDACTED> wrote:
> c(N, M) ->  fac(M) div (fac(N)*fac(M-N)).
> p(P, M, N) -> 1.0 - math:pow(1-P, N-M)*c(N, M).

Are you sure you don't mean
p(P, N, M) -> ...
?

The factorial for -7 will loop forever...

regards,
Vlad



More information about the erlang-questions mailing list