+2024-07-23 Bruno Haible <bruno@clisp.org>
+
+ strtof, strtod, strtold tests: Strengthen tests.
+ * tests/test-strtof.h (test_function): Strengthen the flush-to-zero
+ underflow tests.
+ * tests/test-strtod.h (test_function): Likewise.
+ * tests/test-strtold.h (test_function): Likewise.
+
2024-07-23 Bruno Haible <bruno@clisp.org>
doc: Update for glibc 2.40.
double result;
errno = 0;
result = my_strtod (input, &ptr);
+#if 1
+ ASSERT (result == 0.0);
+#else /* This is all that ISO C guarantees. */
ASSERT (0.0 <= result && result <= DBL_MIN);
+#endif
ASSERT (!signbit (result));
ASSERT (ptr == input + 9);
ASSERT (errno == ERANGE);
double result;
errno = 0;
result = my_strtod (input, &ptr);
+#if 1
+ ASSERT (result == 0.0);
+#else /* This is all that ISO C guarantees. */
ASSERT (-DBL_MIN <= result && result <= 0.0);
+#endif
/* Negative underflow. Expect a negative sign, although POSIX allows +0.0.
See also <https://sourceware.org/bugzilla/show_bug.cgi?id=5995>. */
ASSERT (!!signbit (result) == !!signbit (minus_zerod)); /* glibc-2.3.6, mingw */
float result;
errno = 0;
result = my_strtof (input, &ptr);
+#if 1
+ ASSERT (result == 0.0f);
+#else /* This is all that ISO C guarantees. */
ASSERT (0.0f <= result && result <= FLT_MIN);
+#endif
ASSERT (!signbit (result));
ASSERT (ptr == input + 9);
ASSERT (errno == ERANGE);
float result;
errno = 0;
result = my_strtof (input, &ptr);
+#if 1
+ ASSERT (result == 0.0f);
+#else /* This is all that ISO C guarantees. */
ASSERT (-FLT_MIN <= result && result <= 0.0f);
+#endif
/* Negative underflow. Expect a negative sign, although POSIX allows +0.0f.
See also <https://sourceware.org/bugzilla/show_bug.cgi?id=5995>. */
ASSERT (!!signbit (result) == !!signbit (minus_zerof)); /* glibc-2.3.6, mingw */
long double result;
errno = 0;
result = my_strtold (input, &ptr);
+#if 1
+ ASSERT (result == 0.0L);
+#else /* This is all that ISO C guarantees. */
ASSERT (0.0L <= result && result <= LDBL_MIN);
+#endif
ASSERT (!signbit (result));
ASSERT (ptr == input + 9);
ASSERT (errno == ERANGE);
long double result;
errno = 0;
result = my_strtold (input, &ptr);
+#if 1
+ ASSERT (result == 0.0L);
+#else /* This is all that ISO C guarantees. */
ASSERT (-LDBL_MIN <= result && result <= 0.0L);
+#endif
/* Negative underflow. Expect a negative sign, although POSIX allows +0.0L.
See also <https://sourceware.org/bugzilla/show_bug.cgi?id=5995>. */
ASSERT (!!signbit (result) == !!signbit (minus_zerol)); /* glibc-2.3.2, Haiku */