summaryrefslogtreecommitdiff
path: root/math/math.h
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2013-04-02 13:51:02 +0200
committerThomas Schwinge <thomas@codesourcery.com>2013-04-02 13:51:02 +0200
commit572676160d5639edc0ecb663147bd291841458d1 (patch)
tree26abea75b21e81f568075075249aa3dbedad20c7 /math/math.h
parent60c414c346a1d5ef0510ffbdc0ab75f288ee4d3f (diff)
downloadglibc-572676160d5639edc0ecb663147bd291841458d1.tar.gz
New <math.h> macro named issignaling to check for a signaling NaN (sNaN).
It is based on draft TS 18661 and currently enabled as a GNU extension.
Diffstat (limited to 'math/math.h')
-rw-r--r--math/math.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/math/math.h b/math/math.h
index 2f25c237d4..e3adf096ad 100644
--- a/math/math.h
+++ b/math/math.h
@@ -282,6 +282,20 @@ enum
#endif /* Use ISO C99. */
+#ifdef __USE_GNU
+/* Return nonzero value if X is a signaling NaN. */
+# ifdef __NO_LONG_DOUBLE_MATH
+# define issignaling(x) \
+ (sizeof (x) == sizeof (float) ? __issignalingf (x) : __issignaling (x))
+# else
+# define issignaling(x) \
+ (sizeof (x) == sizeof (float) \
+ ? __issignalingf (x) \
+ : sizeof (x) == sizeof (double) \
+ ? __issignaling (x) : __issignalingl (x))
+# endif
+#endif /* Use GNU. */
+
#ifdef __USE_MISC
/* Support for various different standard error handling behaviors. */
typedef enum