Subject: [Boost-bugs] [Boost C++ Libraries] #6938: weibull_distribution accepts shape == 0, but shape should be >0
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-05-24 12:46:31
#6938: weibull_distribution accepts shape == 0, but shape should be >0
-------------------------------------------------------------+--------------
Reporter: Florian Schoppmann <Florian.Schoppmann@â¦> | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: math
Version: Boost 1.49.0 | Severity: Problem
Keywords: |
-------------------------------------------------------------+--------------
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;
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6938> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC