This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/33060] std::tr1::tgamma produces wrong results [for (x-1) in stead of for x]
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Aug 2007 17:00:29 -0000
- Subject: [Bug libstdc++/33060] std::tr1::tgamma produces wrong results [for (x-1) in stead of for x]
- References: <bug-33060-14973@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pcarlini at suse dot de 2007-08-13 17:00 -------
(In reply to comment #0)
> The implementation of std::tr1::tgamma looks wrong to me.
>
> Keep in mind that the gamma function is equal to the factorial function for
> integer values.
Now I see: this statement is incorrect, and that's why we don't have an issue.
The real relationship is:
gamma(m) == (m - 1)!
As you can check here, for example:
http://en.wikipedia.org/wiki/Gamma_function
http://mathworld.wolfram.com/GammaFunction.html
--
pcarlini at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33060