summary refs log tree commit diff
path: root/math/math.h
diff options
context:
space:
mode:
Diffstat (limited to 'math/math.h')
-rw-r--r--math/math.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/math/math.h b/math/math.h
index 5f5a498b11..bbc1ab9bfa 100644
--- a/math/math.h
+++ b/math/math.h
@@ -65,8 +65,15 @@ __BEGIN_DECLS
 #  define INFINITY HUGE_VALF
 # endif
 
-/* Get machine-dependent NAN value (returned for some domain errors).  */
-# include <bits/nan.h>
+/* IEEE Not A Number.  */
+# if __GNUC_PREREQ (3, 3)
+#  define NAN (__builtin_nanf (""))
+# else
+/* This will raise an "invalid" exception outside static initializers,
+   but is the best that can be done in ISO C while remaining a
+   constant expression.  */
+#  define NAN (0.0f / 0.0f)
+# endif
 #endif /* __USE_ISOC99 */
 
 #if __GLIBC_USE (IEC_60559_BFP_EXT)