diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-09-10 05:55:31 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-09-10 05:55:31 +0000 |
commit | 2b697cfc34dbeea8cc3202f01be6bee2fc6156d9 (patch) | |
tree | fc630ad6c3971d6e33873af819ed579efef29c9b /tests/tset_ld.c | |
parent | 74b439852f89cd21af18027b0cba6582e19af8ed (diff) | |
download | mpfr-2b697cfc34dbeea8cc3202f01be6bee2fc6156d9.tar.gz |
[tests/tset_ld.c] added note
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10840 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tset_ld.c')
-rw-r--r-- | tests/tset_ld.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/tset_ld.c b/tests/tset_ld.c index eae857f24..b1468d786 100644 --- a/tests/tset_ld.c +++ b/tests/tset_ld.c @@ -119,6 +119,14 @@ print_binary (long double d, int flag) printf ("0."); if (flag == 2) printf ("3: d=%.36Le e=%.36Le prec=%ld\n", d, e, (long) prec); + /* Note: the method we use here to extract the bits of r is the following, + to deal with the case where the rounding precision is less than the + precision of r: + (1) we accumulate the upper bits of r into f + (2) when accumulating a new bit into f is not exact, we subtract + f from r and reset f to 0 + This is guaranteed to work only when the rounding precision is at least + half the precision of r, since otherwise r-f might not be exact. */ f = 0.0; /* will hold accumulated powers of 2 */ r = d; /* invariant: r = d - f */ while (r > (long double) 0.0) |