summaryrefslogtreecommitdiff
path: root/include/tgmath.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-12-15 00:49:09 -0500
committerRich Felker <dalias@aerifal.cx>2012-12-15 00:49:09 -0500
commit969ddbc423238291d5c7982790bbe72720627ba4 (patch)
tree54fb3d0a0ddb08549af2704be5dff2ad5dfb1c22 /include/tgmath.h
parent9cb589939cdbfb2fe273bef3fe557a9a162ddd73 (diff)
parenta8f73bb1a685dd7d67669c6f6ceb255cfa967790 (diff)
downloadmusl-969ddbc423238291d5c7982790bbe72720627ba4.tar.gz
Merge remote-tracking branch 'nsz/math'
Diffstat (limited to 'include/tgmath.h')
-rw-r--r--include/tgmath.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/include/tgmath.h b/include/tgmath.h
index 5b65e21f..832b052b 100644
--- a/include/tgmath.h
+++ b/include/tgmath.h
@@ -59,10 +59,12 @@ sizeof(double) == sizeof(long double)
/* function selection */
-#define __tg_real(fun, x) (__RETCAST(x)( \
+#define __tg_real_nocast(fun, x) ( \
__FLT(x) ? fun ## f (x) : \
__LDBL(x) ? fun ## l (x) : \
- fun(x) ))
+ fun(x) )
+
+#define __tg_real(fun, x) (__RETCAST(x)__tg_real_nocast(fun, x))
#define __tg_real_2_1(fun, x, y) (__RETCAST(x)( \
__FLT(x) ? fun ## f (x, y) : \
@@ -217,18 +219,18 @@ sizeof(double) == sizeof(long double)
#define fmod(x,y) __tg_real_2(fmod, (x), (y))
#define frexp(x,y) __tg_real_2_1(frexp, (x), (y))
#define hypot(x,y) __tg_real_2(hypot, (x), (y))
-#define ilogb(x) __tg_real(ilogb, (x))
+#define ilogb(x) __tg_real_nocast(ilogb, (x))
#define ldexp(x,y) __tg_real_2_1(ldexp, (x), (y))
#define lgamma(x) __tg_real(lgamma, (x))
-#define llrint(x) __tg_real(llrint, (x))
-#define llround(x) __tg_real(llround, (x))
+#define llrint(x) __tg_real_nocast(llrint, (x))
+#define llround(x) __tg_real_nocast(llround, (x))
#define log(x) __tg_real_complex(log, (x))
#define log10(x) __tg_real(log10, (x))
#define log1p(x) __tg_real(log1p, (x))
#define log2(x) __tg_real(log2, (x))
#define logb(x) __tg_real(logb, (x))
-#define lrint(x) __tg_real(lrint, (x))
-#define lround(x) __tg_real(lround, (x))
+#define lrint(x) __tg_real_nocast(lrint, (x))
+#define lround(x) __tg_real_nocast(lround, (x))
#define nearbyint(x) __tg_real(nearbyint, (x))
#define nextafter(x,y) __tg_real_2(nextafter, (x), (y))
#define nexttoward(x,y) __tg_real_2(nexttoward, (x), (y))