This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/48114] [C++0x] binomial_distribution incorrect for p > .5 and geometric_distribution wrongly implements the TR1 definition


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48114

--- Comment #10 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2011-03-14 17:57:53 UTC ---
Author: paolo
Date: Mon Mar 14 17:57:48 2011
New Revision: 170946

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170946
Log:
2011-03-14  Andrey Zholos  <aaz@althenia.net>

    PR libstdc++/48114
    * include/bits/random.h (geometric_distribution): Correct formula
    in comment, per C++0x.
    (geometric_distribution<>::param_type::param_type(double)): Fix check.
    (geometric_distribution<>::param_type::_M_initialize):
    Store log(1 - p).
    * include/bits/random.tcc (geometric_distribution<>::operator()):
    Fix computation.
    (binomial_distribution<>::operator()): Likewise.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/random.h
    trunk/libstdc++-v3/include/bits/random.tcc


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]