Skip to content
Prev 3579 / 63421 Next

quantiles of the hypergeometric distribution (PR#502)

Thomas Lumley <thomas@biostat.washington.edu> writes:
Or apply the same fixup:

        sum += (small_N ? term : exp(term));
        ...
        if(small_N) term *= (NR / xr) * (xb / NB);
        else    term += log((NR / xr) * (xb / NB));

which is pretty obviously not optimized for speed, but certainly
avoids the multiply-by-zero effect.