This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/1466] New: wrong branch cut for csqrt()
- From: "fxcoudert at gcc dot gnu dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 11 Oct 2005 22:29:32 -0000
- Subject: [Bug math/1466] New: wrong branch cut for csqrt()
- Reply-to: sourceware-bugzilla at sourceware dot org
#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.