diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-01-27 13:43:16 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-01-27 13:43:16 +0000 |
commit | a9e9d483f1326df8c0943017fbac6e72ee5a74c7 (patch) | |
tree | a98a5a345f29ccd4a0cb96219250a65db379f34f /doc | |
parent | 0736b2273166ece92425c7e1a796280a83c9ab24 (diff) | |
download | mpfr-a9e9d483f1326df8c0943017fbac6e72ee5a74c7.tar.gz |
yet another improvement
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9876 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'doc')
-rw-r--r-- | doc/mpfr.texi | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/mpfr.texi b/doc/mpfr.texi index e39c812a4..95f44e81b 100644 --- a/doc/mpfr.texi +++ b/doc/mpfr.texi @@ -2804,18 +2804,18 @@ is twice as large as with a directed rounding for @var{rnd1} (with the same value of @var{err}). Note: if one wants to also determine the correct @ref{ternary value} when -rounding @var{b} to precision @var{prec} with rounding mode @var{rnd}, +rounding @var{b} to precision @var{prec} with rounding mode @var{rnd2}, a useful trick is the following (where @code{MPFR_RNDZ} can be replaced by any directed rounding mode): @example -if (mpfr_can_round (b, err, MPFR_RNDN, MPFR_RNDZ, - prec + (rnd == MPFR_RNDN))) @{ +if (mpfr_can_round (b, err, rnd1, MPFR_RNDZ, prec + (rnd2 == MPFR_RNDN))) +@{ /* round the approximation 'b' to the result 'r' of 'prec' bits - with rounding mode 'rnd' and get the ternary value 'inex' */ - inex = mpfr_set (r, b, rnd); + with rounding mode 'rnd2' and get the ternary value 'inex' */ + inex = mpfr_set (r, b, rnd2); @} @end example -Indeed, if @var{rnd} is @code{MPFR_RNDN}, this will check if one can +Indeed, if @var{rnd2} is @code{MPFR_RNDN}, this will check if one can round to @var{prec}+1 bits with a directed rounding: if so, one can surely round to nearest to @var{prec} bits, and in addition one can determine the correct ternary value, which would not |