summaryrefslogtreecommitdiff
path: root/tests/tset_ld.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-09-12 08:03:58 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2016-09-12 08:03:58 +0000
commit5a50fb7b05a8c82895aa5da9809ac74bc415b1be (patch)
tree1c155b83962fcc3a621df4827e5d9b29ec7cef7b /tests/tset_ld.c
parent5ea2c86ffd20ce467878a97327b0be9815241517 (diff)
downloadmpfr-5a50fb7b05a8c82895aa5da9809ac74bc415b1be.tar.gz
[tests/tset_ld.c] Simplified a condition in print_binary (BTW, the old
condition was based on the fact that the rounding depended only on the exact result, which may not be the case when rounding is not completely specified, e.g. with double-double arithmetic like on PowerPC). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10842 280ebfd0-de03-0410-8827-d642c229c3f4
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;