summaryrefslogtreecommitdiff
path: root/tests/tset_ld.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tset_ld.c')
-rw-r--r--tests/tset_ld.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/tset_ld.c b/tests/tset_ld.c
index e77218403..a466df068 100644
--- a/tests/tset_ld.c
+++ b/tests/tset_ld.c
@@ -134,12 +134,13 @@ print_binary (long double d, int flag)
prec++;
if (r >= e)
{
- volatile long double g, h;
+ volatile long double g;
if (flag == 1)
printf ("1");
g = f + e;
- h = g - e;
- if (f == g || g == h || f != h) /* f+e is not exact */
+ /* g is close to f (in particular in the cases where f+e may
+ not be exact), so that g - f should be exact. */
+ if (g - f != e) /* f+e is not exact */
{
r = d = d - f; /* should be exact */
f = 0.0;