[Gmp-commit] /var/hg/gmp: 2 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Wed Jan 29 13:35:46 UTC 2014


details:   /var/hg/gmp/rev/1ed31ba93338
changeset: 16268:1ed31ba93338
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Jan 29 14:35:36 2014 +0100
description:
(Floating-point Functions): Revise.

details:   /var/hg/gmp/rev/09c2da8f0aed
changeset: 16269:09c2da8f0aed
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Jan 29 14:35:42 2014 +0100
description:
ChangeLog

diffstat:

 ChangeLog    |   4 ++++
 doc/gmp.texi |  22 ++++++++++++----------
 2 files changed, 16 insertions(+), 10 deletions(-)

diffs (63 lines):

diff -r 6af4d636fc8b -r 09c2da8f0aed ChangeLog
--- a/ChangeLog	Wed Jan 29 14:18:40 2014 +0100
+++ b/ChangeLog	Wed Jan 29 14:35:42 2014 +0100
@@ -1,3 +1,7 @@
+2014-01-29  Torbjorn Granlund  <tege at gmplib.org>
+
+	* doc/gmp.texi (Floating-point Functions): Revise.
+
 2014-01-29  Niels Möller  <nisse at lysator.liu.se>
 
 	* README: Don't refer to specific COPYING* files, instead refer to
diff -r 6af4d636fc8b -r 09c2da8f0aed doc/gmp.texi
--- a/doc/gmp.texi	Wed Jan 29 14:18:40 2014 +0100
+++ b/doc/gmp.texi	Wed Jan 29 14:35:42 2014 +0100
@@ -4563,7 +4563,7 @@
 systems.  In the current implementation the exponent is a count of limbs, so
 for example on a 32-bit system this means a range of roughly
 @math{2^@W{-68719476768}} to @math{2^@W{68719476736}}, or on a 64-bit system
-this will be greater.  Note however @code{mpf_get_str} can only return an
+this will be greater.  Note however that @code{mpf_get_str} can only return an
 exponent which fits an @code{mp_exp_t} and currently @code{mpf_set_str}
 doesn't accept exponents bigger than a @code{long}.
 
@@ -4576,21 +4576,19 @@
 a truncation to the destination precision, but of course the work done is only
 what's needed to determine a result under that definition.
 
-The precision selected for a variable is a minimum value, GMP may increase it
-a little to facilitate efficient calculation.  Currently this means rounding
-up to a whole limb, and then sometimes having a further partial limb,
-depending on the high limb of the mantissa.  But applications shouldn't be
-concerned by such details.
-
-The mantissa is stored in binary, as might be imagined from the fact
-precisions are expressed in bits.  One consequence of this is that decimal
+The precision selected by the user for a variable is a minimum value, GMP may
+increase it a little to facilitate efficient calculation.  Currently this means
+rounding up to a whole limb, and then sometimes having a further partial limb,
+depending on the high limb of the mantissa.
+
+The mantissa is stored in binary.  One consequence of this is that decimal
 fractions like @math{0.1} cannot be represented exactly.  The same is true of
 plain IEEE @code{double} floats.  This makes both highly unsuitable for
 calculations involving money or other values that should be exact decimal
 fractions.  (Suitably scaled integers, or perhaps rationals, are better
 choices.)
 
- at code{mpf} functions and variables have no special notion of infinity or
+The @code{mpf} functions and variables have no special notion of infinity or
 not-a-number, and applications must take care not to overflow the exponent or
 results will be unpredictable.  This might change in a future release.
 
@@ -4599,6 +4597,10 @@
 computer often differ from the results on a computer with a different word
 size.
 
+The GMP extension library MPFR (@url{http://mpfr.org}) is an alternative to
+GMP's @code{mpf} functions.  MPFR provides well-defined precision and accurate
+rounding, and thereby naturally extends IEEE P754.
+
 @menu
 * Initializing Floats::
 * Assigning Floats::


More information about the gmp-commit mailing list