lgamma_r and lgammaf_r return the wrong sign for -0.f
enh at google.com
Thu Sep 18 23:15:53 UTC 2014
thanks. i've moved Android over to your current implementations (and
the ld128 lgammal).
On Wed, Sep 17, 2014 at 12:03 PM, Steve Kargl
<sgk at troutmask.apl.washington.edu> wrote:
> On Fri, Sep 12, 2014 at 02:15:37PM -0700, enh via freebsd-numerics wrote:
>> if I pass -0.f to lgammaf_r, the sign returned in *signgamp is 1. this
>> is incorrect --- it should be -1.
>> both lgamma_r and lgammaf_r are affected, but the other special cases
>> in those functions look fine to me.
>> this is fixed in OpenBSD and glibc, but FreeBSD and NetBSD both have
>> the same bug.
>> 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.
>> btw, it looks like you're missing coshl/sinhl/tanhl for ld128 now?
>> (they've been removed from imprecise.c without having ld128
>> implementations added afaics.)
>> --elliott (Android libc maintainer)
> I committed your patch along with the necessary changes to the
> ld80/e_lgamma_r.c and ld128/e_lgamma_r.c.
> Thanks for bug report.
More information about the freebsd-numerics