Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10110: boost::random::negative_binomial_distribution unnecessary restriction to IntType for parameter k
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-11 08:28:41
#10110: boost::random::negative_binomial_distribution unnecessary restriction to
IntType for parameter k
-------------------------------------+-------------------------------------
Reporter: Maximilian Kleinert | Owner: no-maintainer
<kleinert.max@â¦> | Status: new
Type: Bugs | Component: random
Milestone: To Be Determined | Severity: Problem
Version: Boost 1.55.0 | Keywords: random, negative
Resolution: | binomial distribution
-------------------------------------+-------------------------------------
Comment (by Maximilian Kleinert <kleinert.max@â¦>):
Replying to [comment:4 steven_watanabe]:
> k = 0 and p = 1 are degenerate cases which should be supported.
The case p = 1 (regardless of k) is not supported by the boost version:
The gamma distribution fails because the parameter beta = (1-p)/p is not
greater than zero.
The standard version fails if compiled with -D_GLIBCXX_DEBUG using g++.
The working draft standard (N4926) page 965 requires: 0 < p <= 1 and 0 <
k.
Boost and standard version (except compiled with -D_GLIBCXX_DEBUG) return
in the case p = 0 the sample -2147483648 which is not very useful.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10110#comment:6> 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:18 UTC