seq: work around floating point inaccuracies on more systems
authorJim Meyering <meyering@redhat.com>
Mon, 14 Apr 2008 09:21:26 +0000 (11:21 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 14 Apr 2008 09:29:20 +0000 (11:29 +0200)
commit4827dd27b0c655a685947aaa01426a5ecba179f3
tree6270e3d5bb3eb832ed3d39a312882221b95e52e8
parentf91dec277a0d52489dd58a9f1c9eb4fd54fca7b8
seq: work around floating point inaccuracies on more systems

* src/seq.c: Include <math.h> for fabs.
Include <float.h> for DBL_EPSILON.
(abs_rel_diff): New function.
(print_numbers): Use abs_rel_diff rather than a strict equality test.
Without this change, Solaris 8 and Irix 6.2 would fail the float-6
test.  Reported by Peter Fales in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13183
* src/c99-to-c89.diff: Adjust seq.c offsets.
src/c99-to-c89.diff
src/seq.c