| Submitter | Paolo Carlini |
|---|---|
| Date | Feb. 4, 2013, 5:18 p.m. |
| Message ID | <510FED5B.3010906@oracle.com> |
| Download | mbox | patch |
| Permalink | /patch/217994/ |
| State | New |
| Headers | show |
Comments
Patch
Index: include/bits/random.tcc =================================================================== --- include/bits/random.tcc (revision 195717) +++ include/bits/random.tcc (working copy) @@ -1658,6 +1658,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION do { const double __e = -std::log(1.0 - __aurng()); + if (__t == __x) + { + if (__e) + return __x; + continue; + } __sum += __e / (__t - __x); __x += 1; }