From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 37940b3: min and max now return one of their arguments
Date: Thu, 09 Mar 2017 18:10:46 +0200 [thread overview]
Message-ID: <83shmmfn21.fsf@gnu.org> (raw)
In-Reply-To: <3530106c-241e-c7e5-f01a-7462b98db737@cs.ucla.edu> (message from Paul Eggert on Wed, 8 Mar 2017 14:04:54 -0800)
> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> 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.
next prev parent reply other threads:[~2017-03-09 16:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170307012700.3354.30219@vcs0.savannah.gnu.org>
[not found] ` <20170307012701.1C05D23F1F@vcs0.savannah.gnu.org>
2017-03-07 15:04 ` [Emacs-diffs] master 37940b3: min and max now return one of their arguments Stefan Monnier
2017-03-08 3:04 ` John Wiegley
2017-03-08 6:08 ` Paul Eggert
2017-03-08 15:54 ` Eli Zaretskii
2017-03-08 22:04 ` Paul Eggert
2017-03-09 16:10 ` Eli Zaretskii [this message]
2017-03-09 16:25 ` Clément Pit-Claudel
2017-03-09 16:54 ` Eli Zaretskii
2017-03-09 17:09 ` Clément Pit-Claudel
2017-03-09 17:45 ` Paul Eggert
2017-03-09 18:34 ` Eli Zaretskii
2017-03-07 19:08 ` Glenn Morris
2017-03-08 4:26 ` Tino Calancha
2017-03-08 5:27 ` Paul Eggert
2017-03-08 7:54 ` Andreas Schwab
2017-03-08 8:29 ` Andreas Schwab
2017-03-08 18:47 ` Paul Eggert
2017-03-08 22:10 ` Andreas Schwab
2017-03-11 14:46 ` Andreas Politz
2017-03-12 1:46 ` Tino Calancha
2017-03-12 23:33 ` Andreas Politz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83shmmfn21.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.