[erlang-questions] Frying pan bug

Joe Armstrong erlang@REDACTED
Fri Mar 2 12:42:27 CET 2012


-module(bug).
-compile(export_all).

bug() -> p(0.3, 4, 11).

c(N, M) ->  fac(M) div (fac(N)*fac(M-N)).

fac(0) -> 1;
fac(N) -> N*fac(N-1).

p(P, M, N) -> 1.0 - math:pow(1-P, N-M)*c(N, M).

Running bug:bug() tries to turn my machine into a frying pan

Should this be renamed frying_pan.erl ?

Anybody else see this?


/Joe



More information about the erlang-questions mailing list