Re: [Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-27 15:48:58

#9966: exponential_distribution returns negative zero
  Reporter: mazzamuto@… | Owner: no-maintainer
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: random
   Version: Boost 1.48.0 | Severity: Problem
Resolution: | Keywords:

Comment (by steven_watanabe):

 Replying to [comment:4 mazzamuto@…]:
> I agree that the problem is not with the sign. Indeed I recognize that
 the documentation states: The domain of the random variable is [0, +Inf].

 Which documentation? I don't see any such statement in
 the Boost.Random docs.

> This causes another problem with the upper limit +Inf being documented
 as included. For example, this code should produce the minimum and maximum
 values obtainable from exponential_distribution with lambda=1:

 An exponential_distribution should never produce +Inf. Theoretically,
 lim_{x->\inf} p(x) = 0, so while the values can be arbitrarily large, the
 distribution should never produce infinity. We have to approximate the
 distribution, because floating point cannot represent every real number,
 but adding +Inf as a possible output would severely bias the distribution
 (i.e. the mean would become +Inf). I can't think of any circumstances
 where I would want it to return +Inf.

Ticket URL: <>
Boost C++ Libraries <>
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