diff --git a/include/boost/math/distributions/binomial.hpp b/include/boost/math/distributions/binomial.hpp index b17893e422..93b148eac8 100644 --- a/include/boost/math/distributions/binomial.hpp +++ b/include/boost/math/distributions/binomial.hpp @@ -226,7 +226,7 @@ namespace boost // but zero is the best we can do: return 0; } - if(p == 1 || success_fraction == 1) + if(q == 0 || success_fraction == 1) { // Probability of n or fewer successes is always one, // so n is the most sensible answer here: return trials;