This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

carg, cimag, creal,.. in tgmath.h



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  <aj@suse.de>

	* math/tgmath.h (carg): Handle real arguments.
	(conj): Likewise.
	(cproj): Likewise.
	(cimag): Likewise.
	(creal): Likewise.

============================================================
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.  */
 
 /* Argument value of Z.  */
-#define carg(Val) __TGMATH_UNARY_IMAG_ONLY (Val, carg)
+#define carg(Val) __TGMATH_UNARY_REAL_IMAG (Val, carg, carg)
 
 /* Complex conjugate of Z.  */
-#define conj(Val) __TGMATH_UNARY_IMAG_ONLY (Val, conj)
+#define conj(Val) __TGMATH_UNARY_REAL_IMAG (Val, conj, conj)
 
 /* 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)
 
 
 /* Decomposing complex values.  */
 
 /* Imaginary part of Z.  */
-#define cimag(Val) __TGMATH_UNARY_IMAG_ONLY (Val, cimag)
+#define cimag(Val) __TGMATH_UNARY_REAL_IMAG (Val, cimag, cimag)
 
 /* Real part of Z.  */
-#define creal(Val) __TGMATH_UNARY_IMAG_ONLY (Val, creal)
+#define creal(Val) __TGMATH_UNARY_REAL_IMAG (Val, creal, creal)
 
 #endif /* tgmath.h */

-- 
 Andreas Jaeger, SuSE Linux AG, aj@suse.de, http://www.suse.de/~aj
  GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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