OSDN Git Service

PR libfortran/19302
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Feb 2005 21:39:33 +0000 (21:39 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Feb 2005 21:39:33 +0000 (21:39 +0000)
* intrinsics/c99_functions.c (nextafterf): Special-case infinite
numbers.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95353 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/intrinsics/c99_functions.c

index de81b00..9c0561b 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 7dd9591..f7dc977 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;