summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/random/mtrand/distributions.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/random/mtrand/distributions.c b/numpy/random/mtrand/distributions.c
index bbf02a061..43d35d81d 100644
--- a/numpy/random/mtrand/distributions.c
+++ b/numpy/random/mtrand/distributions.c
@@ -742,7 +742,7 @@ long rk_hypergeometric_hyp(rk_state *state, long good, long bad, long sample)
if (K == 0) break;
}
Z = (long)(d2 - Y);
- if (bad > good) Z = sample - Z;
+ if (good > bad) Z = sample - Z;
return Z;
}
@@ -795,7 +795,7 @@ long rk_hypergeometric_hrua(rk_state *state, long good, long bad, long sample)
}
/* this is a correction to HRUA* by Ivan Frohne in rv.py */
- if (bad > good) Z = m - Z;
+ if (good > bad) Z = m - Z;
/* another fix from rv.py to allow sample to exceed popsize/2 */
if (m < sample) Z = bad - Z;