This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: problem adding complex to newlib/cygwin
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-developers at cygwin dot com
- Date: Mon, 4 Oct 2010 16:55:04 +0200
- Subject: Re: problem adding complex to newlib/cygwin
- References: <230573.53461.qm@web25504.mail.ukl.yahoo.com>
- Reply-to: cygwin-developers at cygwin dot com
On Oct 4 14:37, Marco Atzeri wrote:
> --- Lun 4/10/10, Corinna Vinschen ha scritto:
>
> >
> > Btw., you'll note that cabs and cabsf are already
> > available
> > (from newlib/libm/math/w[f]_cabs.c files):
> >
> > Â cabs NOSIGFE
> > Â _cabs = cabs NOSIGFE
> > Â cabsf NOSIGFE
> > Â _cabsf = cabsf NOSIGFE
> >
>
> I know, the potential problem is that they are slight different
> I need to test if the implementation is the same or not.
> The cleanest way should be to use the new version:
>
> ---------------------------------------------
> double
> cabs(double complex z)
> {
>
> return hypot(__real__ z, __imag__ z);
> }
> ----------------------------------------------
> versus the previous one
>
> -------------------------------------------
> struct complex {
> double x;
> double y;
> };
>
> double
> cabs(z)
> struct complex z;
> {
> return hypot(z.x, z.y);
> }
> -------------------------------------------
Ouch. Yes, that should be replaced.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat