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: [Emacs-diffs] master 37940b3: min and max now return one of their arguments Date: Thu, 9 Mar 2017 09:45:47 -0800 Organization: UCLA Computer Science Department Message-ID: References: <20170307012700.3354.30219@vcs0.savannah.gnu.org> <20170307012701.1C05D23F1F@vcs0.savannah.gnu.org> <83efy7hih9.fsf@gnu.org> <3530106c-241e-c7e5-f01a-7462b98db737@cs.ucla.edu> <83shmmfn21.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1489081603 17804 195.159.176.226 (9 Mar 2017 17:46:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 9 Mar 2017 17:46:43 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 09 18:46:37 2017 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 1cm296-00041C-Ll for ged-emacs-devel@m.gmane.org; Thu, 09 Mar 2017 18:46:36 +0100 Original-Received: from localhost ([::1]:35557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm29C-00013b-L6 for ged-emacs-devel@m.gmane.org; Thu, 09 Mar 2017 12:46:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm28a-00013T-A0 for emacs-devel@gnu.org; Thu, 09 Mar 2017 12:46:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cm28V-0001VC-BN for emacs-devel@gnu.org; Thu, 09 Mar 2017 12:46:04 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45676) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cm28P-0001St-8y; Thu, 09 Mar 2017 12:45:53 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D93621600C2; Thu, 9 Mar 2017 09:45:51 -0800 (PST) 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 g-YgMECpEGZz; Thu, 9 Mar 2017 09:45:51 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 226341600CF; Thu, 9 Mar 2017 09:45:51 -0800 (PST) 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 VYfZGAIuEv_S; Thu, 9 Mar 2017 09:45:51 -0800 (PST) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 085121600C2; Thu, 9 Mar 2017 09:45:51 -0800 (PST) In-Reply-To: <83shmmfn21.fsf@gnu.org> 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:212863 Archived-At: On 03/09/2017 08:10 AM, Eli Zaretskii wrote: >>> Don't programmers >>> assume in general that comparisons between values some of which are >>> floats are always done after converting_all_ values to the >>> floating-point representation? >> No, and that hasn't been true for Emacs Lisp for quite some time. In >> Emacs 25, (<= 10000000000000001 10000000000000000 1e16) returns the >> mathematically-correct answer nil on a 64-bit GNU/Linux host even though >> it would return t if all values were first converted to float. > Not sure what that demonstrates It demonstrates that historically Emacs has been inconsistent in this area. Sometimes it behaves as if it converts all values to floating-point, sometimes not. The example I gave is where Emacs 25 returns the mathematically-correct answer even though converting all values to floating-point would return the mathematically-incorrect answer. There are other examples where Emacs 25 does the opposite. > I get > > (<= 10000000000000001 1e16) => t > > in Emacs 25.1 on a 64-bit GNU/Linux host. > Yes, and that's an example of the opposite. Emacs 25 is inconsistent, and this inconsistency leads to weirdnesses, e.g., it's possible for (<= A C) to be nil even though (<= A B C) is t, because the implementation of <= does not compare consistently. Programmers generally do not expect these weirdnesses, and the patches in master remove them by having Emacs use consistent comparisons.