**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

**Next message:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #10267: boost::enable_if_c incorrect result on IBM xlC compiler"**Previous message:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero"**In reply to:**Boost C++ Libraries: "[Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero with single precision float"**Next in thread:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero"

#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: <https://svn.boost.org/trac/boost/ticket/9966#comment:5> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.

**Next message:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #10267: boost::enable_if_c incorrect result on IBM xlC compiler"**Previous message:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero"**In reply to:**Boost C++ Libraries: "[Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero with single precision float"**Next in thread:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9966: exponential_distribution returns negative zero"

*
This archive was generated by hypermail 2.1.7
: 2017-02-16 18:50:18 UTC
*