public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "brchrisman at gmail dot com" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sourceware.org Subject: [Bug math/27617] New: tgamma integer wrapping results in inaccurate result. Date: Sun, 21 Mar 2021 00:26:02 +0000 [thread overview] Message-ID: <bug-27617-131@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=27617 Bug ID: 27617 Summary: tgamma integer wrapping results in inaccurate result. Product: glibc Version: 2.32 Status: UNCONFIRMED Severity: normal Priority: P2 Component: math Assignee: unassigned at sourceware dot org Reporter: brchrisman at gmail dot com Target Milestone: --- For integer parameters greater than 6, tgamma(n+1) != n! (note: 719 and beyond are off-by-one, while the real parameter at the bottom results in 720) #include <iostream> #include <cmath> using namespace std; int main(void) { uint64_t foo; for(int i=0; i < 10; i++) { foo = tgamma(i); cout << foo << "\n"; } cout << tgamma(7.0) << "\n"; } 0 1 1 2 6 24 120 719 5039 40319 720 -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2021-03-21 0:26 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-21 0:26 brchrisman at gmail dot com [this message] 2021-03-21 1:02 ` [Bug math/27617] " brchrisman at gmail dot com 2021-03-21 1:50 ` brchrisman at gmail dot com 2021-03-21 1:51 ` brchrisman at gmail dot com
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-27617-131@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sourceware.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).