From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 37940b3: min and max now return one of their arguments Date: Thu, 09 Mar 2017 18:10:46 +0200 Message-ID: <83shmmfn21.fsf@gnu.org> 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1489076197 22120 195.159.176.226 (9 Mar 2017 16:16:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 9 Mar 2017 16:16:37 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 09 17:16:30 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 1cm0jl-0004HY-Fn for ged-emacs-devel@m.gmane.org; Thu, 09 Mar 2017 17:16:21 +0100 Original-Received: from localhost ([::1]:35014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm0jr-00055A-Io for ged-emacs-devel@m.gmane.org; Thu, 09 Mar 2017 11:16:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm0hZ-00046C-Fu for emacs-devel@gnu.org; Thu, 09 Mar 2017 11:14:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cm0hT-0001mr-SS for emacs-devel@gnu.org; Thu, 09 Mar 2017 11:14:05 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cm0hT-0001iw-OL; Thu, 09 Mar 2017 11:13:59 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2255 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cm0ei-0001lq-TM; Thu, 09 Mar 2017 11:11:09 -0500 In-reply-to: <3530106c-241e-c7e5-f01a-7462b98db737@cs.ucla.edu> (message from Paul Eggert on Wed, 8 Mar 2017 14:04:54 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:212859 Archived-At: > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > From: Paul Eggert > Date: Wed, 8 Mar 2017 14:04:54 -0800 > > On 03/08/2017 07:54 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, but I get (<= 10000000000000001 1e16) => t in Emacs 25.1 on a 64-bit GNU/Linux host. > More generally, although people expect statically typed languages to > convert alternatives to float (e.g., C programmers expect (1.5 > 2 ? 1.5 > : 2) to return 2.0 not 2), dynamically typed languages are different: > Lisp programmers expect (if (> 1.5 2) 1.5 2) to return 2 not 2.0. I'm not sure this is so, and anyway getting 2.0 should not matter in Emacs Lisp. > > I find the commentary in 'arithcompare' not detailed enough > I installed the attached, which I hope helps. Thanks.