Bug#388852: libc6: csqrt(): non-principal root on -i (per upstream)
Package: libc6
Version: 2.3.6.ds1-4
Severity: normal
Tags: patch
When given a negative imaginary number, csqrt() returns a negative
real part, whereas the principal root should be the one with positive
real part. Sample program below.
I believe this was fixed upstream last year. It'd be nice to have the
same in debian.
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/generic/Attic/s_csqrt.c.diff?r1=1.2&r2=1.3&cvsroot=glibc&hideattic=0
(The s_csqrt.c file moved to under /math, hence this diff being from
the attic.)
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i586)
Shell: /bin/sh linked to /bin/dash
Kernel: Linux 2.6.15-1-486
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)
Versions of packages libc6 depends on:
ii tzdata 2006l-1 Time Zone and Daylight Saving Time
libc6 recommends no packages.
-- no debconf information
#include <complex.h>
#include <stdio.h>
volatile complex double z = - _Complex_I;
int
main (void)
{
z = csqrt (z);
printf ("re=%g im=%g\n", creal (z), cimag (z));
return 0;
}
Reply to: