This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/4407] New: signgam value for lgamma on special values


The signgam value is incorrect for lgamma(-0.), at least on x86 and PowerPC (and
various glibc versions): it is 1, whereas it should be -1 (since tgamma(-0.) is
-inf). For instance, sysdeps/ieee754/dbl-64/e_lgamma_r.c contains:

        if((ix|lx)==0) return one/fabs(x);

i.e. it lets signgam to the value 1, even when x is -0. Other files contains the
same error.

Moreover, on values where tgamma is NaN, the glibc sets signgam to 1. But is
this correct? The POSIX standard is silent on this point, but as the sign isn't
defined, the value of signgam could be left unchanged (and I don't think that
taking into account the sign of the NaN returned by tgamma doesn't really make
much sense). In any case, this should be documented.

-- 
           Summary: signgam value for lgamma on special values
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj at suse dot de
        ReportedBy: vincent+libc at vinc17 dot org
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=4407

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]