about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/test-misc.c83
1 files changed, 81 insertions, 2 deletions
diff --git a/math/test-misc.c b/math/test-misc.c
index c4f9731413..524644d5bd 100644
--- a/math/test-misc.c
+++ b/math/test-misc.c
@@ -132,7 +132,7 @@ main (void)
     f = nextafterf (f, FLT_MIN);
     if (fpclassify (f) != FP_NORMAL)
       {
-	printf ("fpclassify (FLT_MIN-epsilon+epsilong) failed: %d\n",
+	printf ("fpclassify (FLT_MIN-epsilon+epsilon) failed: %d\n",
 		fpclassify (f));
 	result = 1;
       }
@@ -152,10 +152,36 @@ main (void)
     f = nextafterf (f, -FLT_MIN);
     if (fpclassify (f) != FP_NORMAL)
       {
-	printf ("fpclassify (-FLT_MIN-epsilon+epsilong) failed: %d\n",
+	printf ("fpclassify (-FLT_MIN-epsilon+epsilon) failed: %d\n",
 		fpclassify (f));
 	result = 1;
       }
+
+    f = FLT_MAX;
+    if (fpclassify (f) != FP_NORMAL)
+      {
+	printf ("fpclassify (FLT_MAX) failed: %d\n", fpclassify (f));
+	result = 1;
+      }
+    f = nextafterf (f, INFINITY);
+    if (fpclassify (f) != FP_INFINITE)
+      {
+	printf ("fpclassify (FLT_MAX+epsilon) failed: %d\n", fpclassify (f));
+	result = 1;
+      }
+
+    f = -FLT_MAX;
+    if (fpclassify (f) != FP_NORMAL)
+      {
+	printf ("fpclassify (-FLT_MAX) failed: %d\n", fpclassify (f));
+	result = 1;
+      }
+    f = nextafterf (f, -INFINITY);
+    if (fpclassify (f) != FP_INFINITE)
+      {
+	printf ("fpclassify (-FLT_MAX-epsilon) failed: %d\n", fpclassify (f));
+	result = 1;
+      }
   }
   {
     double d;
@@ -199,6 +225,32 @@ main (void)
 		fpclassify (d));
 	result = 1;
       }
+
+    d = DBL_MAX;
+    if (fpclassify (d) != FP_NORMAL)
+      {
+	printf ("fpclassify (DBL_MAX) failed: %d\n", fpclassify (d));
+	result = 1;
+      }
+    d = nextafter (d, INFINITY);
+    if (fpclassify (d) != FP_INFINITE)
+      {
+	printf ("fpclassify (DBL_MAX+epsilon) failed: %d\n", fpclassify (d));
+	result = 1;
+      }
+
+    d = -DBL_MAX;
+    if (fpclassify (d) != FP_NORMAL)
+      {
+	printf ("fpclassify (-DBL_MAX) failed: %d\n", fpclassify (d));
+	result = 1;
+      }
+    d = nextafter (d, -INFINITY);
+    if (fpclassify (d) != FP_INFINITE)
+      {
+	printf ("fpclassify (-DBL_MAX-epsilon) failed: %d\n", fpclassify (d));
+	result = 1;
+      }
   }
 #ifndef NO_LONG_DOUBLE
   {
@@ -245,6 +297,33 @@ main (void)
 		fpclassify (ld), ld);
 	result = 1;
       }
+
+    ld = LDBL_MAX;
+    if (fpclassify (ld) != FP_NORMAL)
+      {
+	printf ("fpclassify (LDBL_MAX) failed: %d\n", fpclassify (ld));
+	result = 1;
+      }
+    ld = nextafterl (ld, INFINITY);
+    if (fpclassify (ld) != FP_INFINITE)
+      {
+	printf ("fpclassify (LDBL_MAX+epsilon) failed: %d\n", fpclassify (ld));
+	result = 1;
+      }
+
+    ld = -LDBL_MAX;
+    if (fpclassify (ld) != FP_NORMAL)
+      {
+	printf ("fpclassify (-LDBL_MAX) failed: %d\n", fpclassify (ld));
+	result = 1;
+      }
+    ld = nextafterl (ld, -INFINITY);
+    if (fpclassify (ld) != FP_INFINITE)
+      {
+	printf ("fpclassify (-LDBL_MAX-epsilon) failed: %d\n",
+		fpclassify (ld));
+	result = 1;
+      }
   }
 #endif