[Bug math/1466] New: wrong branch cut for csqrt()
fxcoudert at gcc dot gnu dot org
sourceware-bugzilla@sourceware.org
Tue Oct 11 22:29:00 GMT 2005
#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.
More information about the Glibc-bugs
mailing list