From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13842 invoked by alias); 15 Jun 2003 16:49:14 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 13825 invoked from network); 15 Jun 2003 16:49:14 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 15 Jun 2003 16:49:14 -0000 Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id 906EC14937 for ; Sun, 15 Jun 2003 18:49:13 +0200 (MEST) Received: from aj by arthur.inka.de with local (Exim 4.12) id 19Ragp-0006E4-00 for libc-hacker@sources.redhat.com; Sun, 15 Jun 2003 18:49:11 +0200 To: GNU libc hacker Subject: carg, cimag, creal,.. in tgmath.h From: Andreas Jaeger Date: Sun, 15 Jun 2003 16:49:00 -0000 Message-ID: User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Portable Code, linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2003-06/txt/msg00025.txt.bz2 --=-=-= Content-Transfer-Encoding: quoted-printable Content-length: 1891 We seem to have bugs with carg, cimag, creal, and fabs: They seem to handle real arguments wrong according to the Dinkumware folks. Looking at the implementation, I do not understand what's broken with fabs, but with carg, cimag and creal we only accept complex arguments. Here's a patch to fix the c* functions. Ok to commit? Andreas 2003-06-15 Andreas Jaeger * math/tgmath.h (carg): Handle real arguments. (conj): Likewise. (cproj): Likewise. (cimag): Likewise. (creal): Likewise. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Index: math/tgmath.h --- math/tgmath.h 3 Mar 2003 19:39:31 -0000 1.20 +++ math/tgmath.h 15 Jun 2003 16:45:13 -0000 @@ -421,21 +421,21 @@ /* Absolute value, conjugates, and projection. */ =20 /* Argument value of Z. */ -#define carg(Val) __TGMATH_UNARY_IMAG_ONLY (Val, carg) +#define carg(Val) __TGMATH_UNARY_REAL_IMAG (Val, carg, carg) =20 /* Complex conjugate of Z. */ -#define conj(Val) __TGMATH_UNARY_IMAG_ONLY (Val, conj) +#define conj(Val) __TGMATH_UNARY_REAL_IMAG (Val, conj, conj) =20 /* Projection of Z onto the Riemann sphere. */ -#define cproj(Val) __TGMATH_UNARY_IMAG_ONLY (Val, cproj) +#define cproj(Val) __TGMATH_UNARY_REAL_IMAG (Val, cproj, cproj) =20 =20 /* Decomposing complex values. */ =20 /* Imaginary part of Z. */ -#define cimag(Val) __TGMATH_UNARY_IMAG_ONLY (Val, cimag) +#define cimag(Val) __TGMATH_UNARY_REAL_IMAG (Val, cimag, cimag) =20 /* Real part of Z. */ -#define creal(Val) __TGMATH_UNARY_IMAG_ONLY (Val, creal) +#define creal(Val) __TGMATH_UNARY_REAL_IMAG (Val, creal, creal) =20 #endif /* tgmath.h */ --=20 Andreas Jaeger, SuSE Linux AG, aj@suse.de, http://www.suse.de/~aj GPG fingerprint =3D 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 --=-=-= Content-Type: application/pgp-signature Content-length: 197 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQA+7KOHOJpWPMJyoSYRAhsgAJ9xYanJzeM0j3YjQShiM5fWueP1wgCfVNmt csuukt5Tss2j43RJffHppg0= =FJVX -----END PGP SIGNATURE----- --=-=-=--