------- Comment #17 from sgk at troutmask dot apl dot washington dot edu 2006-10-28 03:48 ------- Subject: Re: transcendental functions with constant arguments should be resolved at compile-time
On Sat, Oct 28, 2006 at 03:20:11AM -0000, ghazi at gcc dot gnu dot org wrote: > > > ------- Comment #16 from ghazi at gcc dot gnu dot org 2006-10-28 03:20 > ------- > I'm getting wierd NaN results when I hook up __builtin_lgamma to > mpfr_lngamma. > I can expose the problem using a standlone C program calling mpfr like so. > Results are first, C testcase is second. Now I know lgamma/mpfr_lngamma are > both documented to barf on negative integers. But as you can see, I'm passing > x.5 in every case. Seems like any time "x" is an even number I get a NaN. I > wonder if this is a bug in mpfr, or my mistake? (I tried mpfr-2.2.0 with and > without the cumulative patch. I got the problem in both cases.) Can anyone > else reproduce this? > > lgamma(-4.50) = -2.813084 > mpfr_lngamma(-4.50) = @NaN@ > Yes, I can reproduce the NaN. In fact, any negative value gives a NaN. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29335