about summary refs log tree commit diff
path: root/math/bug-nextafter.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/bug-nextafter.c')
-rw-r--r--math/bug-nextafter.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/math/bug-nextafter.c b/math/bug-nextafter.c
new file mode 100644
index 0000000000..8aa849df19
--- /dev/null
+++ b/math/bug-nextafter.c
@@ -0,0 +1,28 @@
+#include <math.h>
+#include <float.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+int
+main (void)
+{
+  int result = 0;
+
+  float i = INFINITY;
+  float m = FLT_MAX;
+  if (nextafterf (m, i) != i)
+    {
+      puts ("nextafterf failed");
+      ++result;
+    }
+
+  double di = INFINITY;
+  double dm = DBL_MAX;
+  if (nextafter (dm, di) != di)
+    {
+      puts ("nextafter failed");
+      ++result;
+    }
+
+  return result;
+}