http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56202
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2013-02-04 15:46:39 UTC --- Hum, this seems to be the second waiting method described in page 41 of http://luc.devroye.org/chapter_ten.pdf which specifically says that sum can be infinite. So I think it should be enough to check that __t == __x and return __x in that case. do { const double __e = -std::log(1.0 - __aurng()); if(__t == __x) return __x; __sum += __e / (__t - __x); __x += 1; } while (__sum <= _M_param._M_q); No?