/* A GNU-like <math.h>.
- Copyright (C) 2002-2003, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2007-2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* POSIX allows platforms that don't support NAN. But all major
machines in the past 15 years have supported something close to
- IEEE NaN, so we define this unconditionally. */
-#ifndef NAN
+ IEEE NaN, so we define this unconditionally. We also must define
+ it on platforms like Solaris 10, where NAN is present but defined
+ as a function pointer rather than a floating point constant. */
+#if !defined NAN || @REPLACE_NAN@
+# undef NAN
/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */
# ifdef __DECC
static float
# endif
#endif
+/* Solaris 10 defines HUGE_VAL, but as a function pointer rather
+ than a floating point constant. */
+#if @REPLACE_HUGE_VAL@
+# undef HUGE_VAL
+# define HUGE_VAL (1.0 / 0.0)
+#endif
+
/* Write x as
x = mantissa * 2^exp
where