summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTorbjorn Granlund <torbjorng@google.com>2015-04-14 12:45:32 +0200
committerTorbjorn Granlund <torbjorng@google.com>2015-04-14 12:45:32 +0200
commite99d796ef458ffb239f9f3264da160c6e93d5126 (patch)
treee07a06e04cef61524bd7ef5f66f19e100cdde0de /doc
parentb7237be60e4000d89e1795ecb52f21b44b82277f (diff)
downloadgmp-e99d796ef458ffb239f9f3264da160c6e93d5126.tar.gz
Further clarify mpf_eq documentation.
Diffstat (limited to 'doc')
-rw-r--r--doc/gmp.texi14
1 files changed, 5 insertions, 9 deletions
diff --git a/doc/gmp.texi b/doc/gmp.texi
index 9c008bff3..eff6bc3a1 100644
--- a/doc/gmp.texi
+++ b/doc/gmp.texi
@@ -4968,16 +4968,12 @@ a NaN.
@end deftypefun
@deftypefun int mpf_eq (const mpf_t @var{op1}, const mpf_t @var{op2}, mp_bitcnt_t op3)
-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.
+@strong{This function is mathematically ill-defined and should not be used.}
-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.
+Return non-zero if the first @var{op3} bits of @var{op1} and @var{op2} are
+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})