public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/114359] std::binomial_distribution hangs in infinite loop Date: Sat, 16 Mar 2024 10:18:02 +0000 [thread overview] Message-ID: <bug-114359-4-kvjrhB1Gl5@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-114359-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114359 --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- This seems to fix it: --- a/libstdc++-v3/include/bits/random.tcc +++ b/libstdc++-v3/include/bits/random.tcc @@ -1503,7 +1503,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // sqrt(pi / 2) const double __spi_2 = 1.2533141373155002512078826424055226L; _M_s1 = std::sqrt(__np * __1p) * (1 + _M_d1 / (4 * __np)); - _M_s2 = std::sqrt(__np * __1p) * (1 + _M_d2 / (4 * _M_t * __1p)); + _M_s2 = std::sqrt(__np * __1p) * (1 + _M_d2 / (4 * (_M_t * __1p))); _M_c = 2 * _M_d1 / __np; _M_a1 = std::exp(_M_c) * _M_s1 * __spi_2; const double __a12 = _M_a1 + _M_s2 * __spi_2;
next prev parent reply other threads:[~2024-03-16 10:18 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-16 3:55 [Bug libstdc++/114359] New: " angelo.landi at outlook dot com 2024-03-16 4:02 ` [Bug libstdc++/114359] " pinskia at gcc dot gnu.org 2024-03-16 5:08 ` angelo.landi at outlook dot com 2024-03-16 10:10 ` redi at gcc dot gnu.org 2024-03-16 10:18 ` redi at gcc dot gnu.org [this message] 2024-03-18 13:40 ` redi at gcc dot gnu.org 2024-03-19 16:00 ` cvs-commit at gcc dot gnu.org 2024-03-19 16:02 ` redi at gcc dot gnu.org 2024-05-14 9:52 ` cvs-commit at gcc dot gnu.org 2024-05-14 9:56 ` redi at gcc dot gnu.org 2024-06-11 17:06 ` cvs-commit at gcc dot gnu.org 2024-06-11 17:10 ` redi at gcc dot gnu.org 2024-06-13 23:30 ` cvs-commit at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-114359-4-kvjrhB1Gl5@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).