Guarantee a definition of NAN.
[gnulib.git] / tests / test-roundf1.c
index 67d5c7f..aeee3b1 100644 (file)
@@ -1,9 +1,9 @@
 /* Test of rounding to nearest, breaking ties away from zero.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 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
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
     }                                                                       \
   while (0)
 
-/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
-#ifdef __DECC
-static float
-NaN ()
-{
-  static float zero = 0.0f;
-  return zero / zero;
-}
-#else
-# define NaN() (0.0f / 0.0f)
-#endif
-
 int
 main ()
 {
@@ -86,7 +74,7 @@ main ()
   ASSERT (roundf (1.0 / 0.0f) == 1.0 / 0.0f);
   ASSERT (roundf (-1.0 / 0.0f) == -1.0 / 0.0f);
   /* NaNs.  */
-  ASSERT (isnanf (roundf (NaN ())));
+  ASSERT (isnanf (roundf (NAN)));
 
   return 0;
 }