#include <getopt.h>
#include <stdio.h>
#include <sys/types.h>
-#include <math.h>
-#include <float.h>
#include "system.h"
#include "c-strtod.h"
return NULL;
}
-/* Return the absolute relative difference from x to y. */
-static double
-abs_rel_diff (double x, double y)
-{
- double s = (y == 0.0 ? 1 : y);
- return fabs ((y - x) / s);
-}
-
/* Actually print the sequence of numbers in the specified range, with the
given or default stepping and format. */
x_str[x_strlen - layout.suffix_len] = '\0';
if (xstrtold (x_str + layout.prefix_len, NULL, &x_val, c_strtold)
- && abs_rel_diff (x_val, last) < DBL_EPSILON)
+ && x_val == last)
{
char *x0_str = NULL;
if (asprintf (&x0_str, fmt, x0) < 0)
{OUT_SUBST => 's,^-0\.0$,0.0,'},
],
['float-5', qw(0.8 1e-1 0.9), {OUT => [qw(0.8 0.9)]}],
- ['float-6', qw(0.8 0.1 0.90000000000000000000), {OUT => [qw(0.8 0.9)]}],
+ # Don't append lots of zeros to that 0.9000...; for example, changing the
+ # number to 0.90000000000000000000 tickles a bug in Solaris 8 strtold
+ # that would cause the test to fail.
+ ['float-6', qw(0.8 0.1 0.9000000000000), {OUT => [qw(0.8 0.9)]}],
['wid-1', qw(.8 1e-2 .81), {OUT => [qw(0.80 0.81)]}],
['wid-2', qw(.89999 1e-7 .8999901), {OUT => [qw(0.8999900 0.8999901)]}],