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/1466] New: wrong branch cut for csqrt()


#include <stdio.h>
#include <complex.h>

int main(void) {
   complex float z;
   __real__ z =  0.f;
   __imag__ z = -1.f;
   z = csqrtf(z);
   printf("%e %e\n", crealf(z), cimag(z));
}

The correct answer is cos(pi/4) - i * sin(pi/4). We now have:

$ gcc a.c -std=c99 -lm && ./a.out
-7.071068e-01 7.071068e-01

-- 
           Summary: wrong branch cut for csqrt()
           Product: glibc
           Version: 2.3.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj at suse dot de
        ReportedBy: fxcoudert at gcc dot gnu dot org
                CC: glibc-bugs at sources dot redhat dot com
GCC target triplet: i386-redhat-linux


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

------- 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]