[Gmp-commit] /var/hg/gmp: Further clarify mpf_eq documentation.

mercurial at gmplib.org mercurial at gmplib.org
Tue Apr 14 10:46:29 UTC 2015


details:   /var/hg/gmp/rev/785d66ddd532
changeset: 16574:785d66ddd532
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Tue Apr 14 12:45:32 2015 +0200
description:
Further clarify mpf_eq documentation.

diffstat:

 doc/gmp.texi |  14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diffs (25 lines):

diff -r c272212664b5 -r 785d66ddd532 doc/gmp.texi
--- a/doc/gmp.texi	Mon Apr 13 23:14:29 2015 +0200
+++ b/doc/gmp.texi	Tue Apr 14 12:45:32 2015 +0200
@@ -4968,16 +4968,12 @@
 @end deftypefun
 
 @deftypefun int mpf_eq (const mpf_t @var{op1}, const mpf_t @var{op2}, mp_bitcnt_t op3)
+ at strong{This function is mathematically ill-defined and should not be used.}
+
 Return non-zero if the first @var{op3} bits of @var{op1} and @var{op2} are
-equal, zero otherwise.  I.e., test if @var{op1} and @var{op2} are approximately
-equal.
-
-Caution 1: All version of GMP up to version 4.2.4 compared just whole limbs,
-meaning sometimes more than @var{op3} bits, sometimes fewer.
-
-Caution 2: This function will consider XXX11...111 and XX100...000 different,
-even if ... is replaced by a semi-infinite number of bits.  Such numbers are
-really just one ulp off, and should be considered equal.
+equal, zero otherwise.  Note that numbers like e.g., 256 (binary 100000000) and
+255 (binary 11111111) will never be equal by this function's measure, and
+furthermore that 0 will only be equal to itself.
 @end deftypefun
 
 @deftypefun void mpf_reldiff (mpf_t @var{rop}, const mpf_t @var{op1}, const mpf_t @var{op2})


More information about the gmp-commit mailing list