re PR libfortran/19302 (intrinsic_nearest.f90 fails)
authorEric Botcazou <ebotcazou@libertysurf.fr>
Mon, 21 Feb 2005 21:39:33 +0000 (22:39 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 21 Feb 2005 21:39:33 +0000 (21:39 +0000)
PR libfortran/19302
* intrinsics/c99_functions.c (nextafterf): Special-case infinite
numbers.

From-SVN: r95353

libgfortran/ChangeLog
libgfortran/intrinsics/c99_functions.c

index de81b000ad934e159868401566c5536c2045b861..9c0561b04c34eb85013a44332d10b4f262a4a41c 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-21  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR libfortran/19302
+       * intrinsics/c99_functions.c (nextafterf): Special-case infinite
+       numbers.
+
 2005-02-21  Steven G. Kargl  <kargls@comcast.net>
 
        * io/write.c (output_float):  Typo in error meesage.
index 7dd95918dcd0674bbde52013cd477e2d65a0a955..f7dc9777dd83c1d210d6cf2dd042f38d3d6a8a17 100644 (file)
@@ -218,6 +218,8 @@ nextafterf(float x, float y)
     return x + y;
   if (x == y)
     return x;
+  if (!isfinite (x))
+    return x > 0 ? __FLT_MAX__ : - __FLT_MAX__;
 
   /* absx = fabsf (x);  */
   absx = (x < 0.0) ? -x : x;