This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [PATCH] libgfortran/24313 wrong branch cut for csqrt()


On Tue, Oct 11, 2005 at 11:48:03PM +0200, FX Coudert wrote:
> >>Someone should file one with them at
> >>http://sourceware.org/bugzilla/
> >
> >Yes, someone ought to submit a bug report.  Unfortnately, that URL
> >requires an account and password to submit a report.
> 
> I have an account there and I will submit a bugreport if someone 
> provides me with a clear C testcase (I don't have time to look into the 
> details of it, sorry).
> 

Point glibc developers at

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24313

I can't test the below code, but it should demonstrate
the problem.  The correct answer is cos(pi/4) - i * sin(pi/4).

#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));
}

-- 
Steve


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