From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: bignum branch Date: Fri, 20 Jul 2018 13:58:18 -0700 Organization: UCLA Computer Science Department Message-ID: <1d462611-72f7-f4b8-8a62-56c97379b6f7@cs.ucla.edu> References: <87o9fbbw1t.fsf@tromey.com> <83wotu7fcj.fsf@gnu.org> <83k1pt7q1e.fsf@gnu.org> <83h8kx7oeu.fsf@gnu.org> <83fu0h7nr6.fsf@gnu.org> <83d0vl7kg2.fsf@gnu.org> <4bc2a6ba-bc73-c4a9-f7a6-20303955bc7f@cs.ucla.edu> <838t696zb2.fsf@gnu.org> <5095f6d2-c8c1-8d9b-4f4f-ccb74a68d58e@cs.ucla.edu> <8547e501-a41f-68eb-6e00-5fed6c593da4@gmail.com> <73e5dd79-d7d5-3bec-f991-04ceb5d3472d@gmail.com> <87o9f45ot8.fsf@Rainer.invalid> <447774de-c305-5478-1438-7794344456d4@cs.ucla.edu> <87muuly8sv.fsf@Rainer.invalid> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------7A4830E9AD0D9E33DE9DA61D" X-Trace: blaine.gmane.org 1532120219 9860 195.159.176.226 (20 Jul 2018 20:56:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 20 Jul 2018 20:56:59 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: Achim Gratz , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 20 22:56:55 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgcSN-0002Tg-CI for ged-emacs-devel@m.gmane.org; Fri, 20 Jul 2018 22:56:55 +0200 Original-Received: from localhost ([::1]:49752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgcUU-0000b2-Ep for ged-emacs-devel@m.gmane.org; Fri, 20 Jul 2018 16:59:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgcTp-0000aw-HR for emacs-devel@gnu.org; Fri, 20 Jul 2018 16:58:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgcTm-0001zI-G9 for emacs-devel@gnu.org; Fri, 20 Jul 2018 16:58:25 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58560) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fgcTm-0001i3-2X for emacs-devel@gnu.org; Fri, 20 Jul 2018 16:58:22 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4F5A2160E60; Fri, 20 Jul 2018 13:58:19 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id VNzfP-n5afWV; Fri, 20 Jul 2018 13:58:18 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 74D58160EC1; Fri, 20 Jul 2018 13:58:18 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3-eRVINa3kNZ; Fri, 20 Jul 2018 13:58:18 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 53B0A160E60; Fri, 20 Jul 2018 13:58:18 -0700 (PDT) Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS 96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd7gx07Auwp7iw7eNvnoDTAl KAl8KYDZzbDNCQGEbpY3efZIvPdeI+FWQN4W+kghy+P6au6PrIIhYraeua7XDdb2LS1en3Ss mE3QjqfRqI/A2ue8JMwsvXe/WK38Ezs6x74iTaqI3AFH6ilAhDqpMnd/msSESNFt76DiO1ZK QMr9amVPknjfPmJISqdhgB1DlEdw34sROf6V8mZw0xfqT6PKE46LcFefzs0kbg4GORf8vjG2 Sf1tk5eU8MBiyN/bZ03bKNjNYMpODDQQwuP84kYLkX2wBxxMAhBxwbDVZudzxDZJ1C2VXujC OJVxq2kljBM9ETYuUGqd75AW2LXrLw6+MuIsHFAYAgRr7+KcwDgBAfwhPBYX34nSSiHlmLC+ KaHLeCLF5ZI2vKm3HEeCTtlOg7xZEONgwzL+fdKo+D6SoC8RRxJKs8a3sVfI4t6CnrQzvJbB n6gxdgCu5i29J1QCYrCYvql2UyFPAK+do99/1jOXT4m2836j1wARAQABzSBQYXVsIEVnZ2Vy dCA8ZWdnZXJ0QGNzLnVjbGEuZWR1PsLBfgQTAQIAKAUCTIByZAIbAwUJEswDAAYLCQgHAwIG FQgCCQoLBBYCAwECH In-Reply-To: <87muuly8sv.fsf@Rainer.invalid> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227596 Archived-At: This is a multi-part message in MIME format. --------------7A4830E9AD0D9E33DE9DA61D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 07/20/2018 01:02 PM, Achim Gratz wrote: > maybe the doc string for eql should > directly indicate that the representations of the FP numbers are > compared bit-wise, which is distinct from their numerical values as > prescribed by IEEE754 (and that comparison is done via =)? Sure, I took a stab at that and installed the attached. --------------7A4830E9AD0D9E33DE9DA61D Content-Type: text/x-patch; name="0001-src-fns.c-Feql-Fequal-Improve-floating-point-doc.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-src-fns.c-Feql-Fequal-Improve-floating-point-doc.patch" >From 64a168519df8c3f842df11dab01eabbfc35a42c4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 20 Jul 2018 13:55:12 -0700 Subject: [PATCH] * src/fns.c (Feql, Fequal): Improve floating-point doc. --- src/fns.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/fns.c b/src/fns.c index 7d120a90f7..e7424c3471 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2193,8 +2193,10 @@ The PLIST is modified by side effects. */) } DEFUN ("eql", Feql, Seql, 2, 2, 0, - doc: /* Return t if the two args are the same Lisp object. -Floating-point numbers of equal value are `eql', but they may not be `eq'. */) + doc: /* Return t if the two args are `eq' or are indistinguishable numbers. +Floating-point values with the same sign, exponent and fraction are `eql'. +This differs from numeric comparison: (eql 0.0 -0.0) returns nil and +\(eql 0.0e+NaN 0.0e+NaN) returns t, whereas `=' does the opposite. */) (Lisp_Object obj1, Lisp_Object obj2) { if (FLOATP (obj1)) @@ -2208,8 +2210,8 @@ DEFUN ("equal", Fequal, Sequal, 2, 2, 0, They must have the same data type. Conses are compared by comparing the cars and the cdrs. Vectors and strings are compared element by element. -Numbers are compared by value, but integers cannot equal floats. - (Use `=' if you want integers and floats to be able to be equal.) +Numbers are compared via `eql', so integers do not equal floats. +\(Use `=' if you want integers and floats to be able to be equal.) Symbols must match exactly. */) (Lisp_Object o1, Lisp_Object o2) { -- 2.17.1 --------------7A4830E9AD0D9E33DE9DA61D--