* lib/strtod.c (scale_radix_exp): If the result is a denormalized
number, set errno to ERANGE.
+2024-07-23 Bruno Haible <bruno@clisp.org>
+
+ strtod, strtold: Set errno upon gradual underflow.
+ * lib/strtod.c (scale_radix_exp): If the result is a denormalized
+ number, set errno to ERANGE.
+
2024-07-21 Bruno Haible <bruno@clisp.org>
bootstrap: Avoid failure when gnulib-tool removed gettext.m4.
{
if (e < 0)
{
- while (e++ != 0)
+ for (;;)
{
+ if (e++ == 0)
+ {
+ if (r < MIN && r > -MIN)
+ /* Gradual underflow, resulting in a denormalized
+ number. */
+ errno = ERANGE;
+ break;
+ }
r /= radix;
- if (r == 0 && x != 0)
+ if (r == 0)
{
+ /* Flush-to-zero underflow. */
errno = ERANGE;
break;
}