2008-04-01 Bruno Haible <bruno@clisp.org>
+ Fix test to work on IRIX 6.5 with cc.
+ * tests/test-math.c (numeric_equal): New function.
+ (main): Use it.
+
+2008-04-01 Bruno Haible <bruno@clisp.org>
+
* doc/posix-headers/math.texi: Refine documentation of NAN problem.
2008-04-01 Bruno Haible <bruno@clisp.org>
static float n = NAN;
#endif
+/* Compare two numbers with ==.
+ This is a separate function because IRIX 6.5 "cc -O" miscompiles an
+ 'x == x' test. */
+static int
+numeric_equal (double x, double y)
+{
+ return x == y;
+}
+
int
main ()
{
double d = NAN;
- return d == d;
+ if (numeric_equal (d, d))
+ return 1;
+ return 0;
}