aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/bug-tgmath1.c14
-rw-r--r--math/tgmath.h4
2 files changed, 16 insertions, 2 deletions
diff --git a/math/bug-tgmath1.c b/math/bug-tgmath1.c
index 8a457fa252..16db9d17a1 100644
--- a/math/bug-tgmath1.c
+++ b/math/bug-tgmath1.c
@@ -29,5 +29,19 @@ main (void)
TEST (cimag (1.0f), sizeof (float));
TEST (cimag (1.0f + 1.0fi), sizeof (float));
+ TEST (fabs (1.0), sizeof (double));
+ TEST (fabs (1.0 + 1.0i), sizeof (double));
+ TEST (fabs (1.0l), sizeof (long double));
+ TEST (fabs (1.0l + 1.0li), sizeof (long double));
+ TEST (fabs (1.0f), sizeof (float));
+ TEST (fabs (1.0f + 1.0fi), sizeof (float));
+
+ TEST (carg (1.0), sizeof (double));
+ TEST (carg (1.0 + 1.0i), sizeof (double));
+ TEST (carg (1.0l), sizeof (long double));
+ TEST (carg (1.0l + 1.0li), sizeof (long double));
+ TEST (carg (1.0f), sizeof (float));
+ TEST (carg (1.0f + 1.0fi), sizeof (float));
+
return retval;
}
diff --git a/math/tgmath.h b/math/tgmath.h
index 0202e100bc..ab2cc929ad 100644
--- a/math/tgmath.h
+++ b/math/tgmath.h
@@ -346,7 +346,7 @@
#define ceil(Val) __TGMATH_UNARY_REAL_ONLY (Val, ceil)
/* Absolute value of X. */
-#define fabs(Val) __TGMATH_UNARY_REAL_IMAG (Val, fabs, cabs)
+#define fabs(Val) __TGMATH_UNARY_REAL_IMAG_RET_REAL (Val, fabs, cabs)
/* Largest integer not greater than X. */
#define floor(Val) __TGMATH_UNARY_REAL_ONLY (Val, floor)
@@ -439,7 +439,7 @@
/* Absolute value, conjugates, and projection. */
/* Argument value of Z. */
-#define carg(Val) __TGMATH_UNARY_REAL_IMAG (Val, carg, carg)
+#define carg(Val) __TGMATH_UNARY_REAL_IMAG_RET_REAL (Val, carg, carg)
/* Complex conjugate of Z. */
#define conj(Val) __TGMATH_UNARY_REAL_IMAG (Val, conj, conj)