Opened 10 years ago
Closed 10 years ago
#6938 closed Bugs (fixed)
weibull_distribution accepts shape == 0, but shape should be >0
| Reported by: | Owned by: | John Maddock | |
|---|---|---|---|
| Milestone: | Boost 1.51.0 | Component: | math |
| Version: | Boost 1.49.0 | Severity: | Problem |
| Keywords: | Cc: | pbristow@… |
Description
In function check_weibull_shape() in file math/distributions/weibull.hpp a domain error is only raised if shape < 0. The error condition should probably be shape <= 0. With shape == 0, the Weibull distribution is not well-defined. Also, shape == 0 contradicts the error message in the same function.
E.g., the following example raises an overflow error, but not a domain error (as would be more appropriate IMHO):
#include <boost/math/distributions/weibull.hpp>
using namespace boost::math;
int main() {
std::cout << mean(weibull(0)) << std::endl;
}
Change History (3)
comment:1 by , 10 years ago
| Cc: | added |
|---|---|
| Milestone: | To Be Determined → Boost 1.51.0 |
| Status: | new → assigned |
comment:2 by , 10 years ago
comment:3 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.

Confirmed, will fix.