Date: Fri, 12 Sep 2014 15:51:52 -0700 From: enh <enh@google.com> To: Steve Kargl <sgk@troutmask.apl.washington.edu> Cc: freebsd-numerics@freebsd.org Subject: Re: lgamma_r and lgammaf_r return the wrong sign for -0.f Message-ID: <CAJgzZoqJg1t_A8e9iTpMvWFH0aQWMTOwGR_5yYgPAMm1LL9f4A@mail.gmail.com> In-Reply-To: <20140912224112.GA97578@troutmask.apl.washington.edu> References: <CAJgzZopa-d=eR7zkqhffsjMY0NEavhqDA-B3V9bQdaJd6BMO2A@mail.gmail.com> <20140912220544.GA96714@troutmask.apl.washington.edu> <CAJgzZoruuVxLJ1sdue-NmvxKJwW7WKrY6GsopKMQi3Us4goxCQ@mail.gmail.com> <20140912224112.GA97578@troutmask.apl.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 12, 2014 at 3:41 PM, Steve Kargl <sgk@troutmask.apl.washington.edu> wrote: > On Fri, Sep 12, 2014 at 03:17:02PM -0700, enh via freebsd-numerics wrote: >> On Fri, Sep 12, 2014 at 3:05 PM, Steve Kargl >> > F.9.5.3 The lgamma functions >> > -- lgamma(1) returns +0. >> > -- lgamma(2) returns +0. >> > -- lgamma(x) returns +inf and raises the ``divide-by-zero'' floating-point >> > exception for x a negative integer or zero. >> > -- lgamma(-inf) returns +inf. >> > -- lgamma(+inf) returns +inf. >> > >> > See the 3rd bullet. -0 is 0 and -0 is a negative integer. > > Of course, neither POSIX nor ISO C specify lgamma_r() only lgamma. > I just spent too much time on the 'divide-by-zero' bug, and > conflated that with signgam. i think the reporter's feeling was that *signgamp should be -1 because as x approaches 0 from the negative side, Gamma(x) approaches -Infinity. (though i suspect they noticed this when porting code from glibc.) >> > POSIX appears to defer to ISO C. n1570.pdf (committe draft for C11) >> > has (almost?) identical text. >> > >> >> patch below (whitespace mangled courtesy of gmail). i'd prefer to wait >> >> for this to be fixed in FreeBSD and pull down the fix rather than just >> >> fix it locally. >> > >> > I have a bigger patch coming with ld80 and ld128 version of lgammal >> > and lgammal_r. >> >> sorry, i haven't even looked at the *l variants. > > I only just finished writing the *l variants. It took me > a long time to unwind the comments in e_lgamma_r.c, > so that I could write the long double versions. is there a freebsd-numerics-commits or equivalent i could subscribe to?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJgzZoqJg1t_A8e9iTpMvWFH0aQWMTOwGR_5yYgPAMm1LL9f4A>