Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
From: Daniel J Sebald <daniel.sebald@ie...> - 2006-09-27 22:59:13
Hans-Bernhard Br=F6ker wrote:
> Daniel J Sebald wrote:
>> There may be more to this. I see now that "signgam" is actually an
>> external as part of the math library I'm guessing. =20
> No need for guessing --- that's what you have libc/libm manpages for.
> > So, if I
>> understand this, calling gamma() (i.e., the "old gamma" which is
>> actually ln gamma) will set the sign of the gamma function upon
>> calling gamma(). How is an optimizing compiler to know that?
> It doesn't have to. signgam is a global variable, exported by the=20
> library, and the code reads it.
Right. Well, there is also what Ethan pointed out. The use of a global =
variable in a library isn't thread safe, so using lgamma_r() would be pre=
>> Anyway, maybe just avoiding the use of "signgam" in any way is best.
> We can't do that. Not on platforms that don't sport a tgamma(), anyway.
And I'm wondering how many platforms that is. If it is a small percentag=
e and getting smaller, then rewriting gnuplot's gamma function to be "tru=
e gamma" and not using signgam/lgamma would be a straightfoward approach.