From c532b2a8ef48d317a1bc348584c00880ea7c5ba6 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 20 Oct 2007 14:34:54 +0200 Subject: Don't rely on excess precision: -4 > -3.00000024 - 1 can evaluate to false if the CPU rounds correctly to nearest. --- tests/test-trunc2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test-trunc2.c') diff --git a/tests/test-trunc2.c b/tests/test-trunc2.c index 5292ff64ff..f3238ffe2c 100644 --- a/tests/test-trunc2.c +++ b/tests/test-trunc2.c @@ -113,10 +113,10 @@ correct_result_p (DOUBLE x, DOUBLE result) return (x >= 0 ? (x < 1 ? result == L_(0.0) : - x - 1 < x ? result <= x && result > x - 1 : + x - 1 < x ? result <= x && result >= x - 1 && x - result < 1 : equal (result, x)) : (x > -1 ? result == L_(0.0) : - x + 1 > x ? result >= x && result < x + 1 : + x + 1 > x ? result >= x && result <= x + 1 && result - x < 1 : equal (result, x))); } -- cgit v1.2.1