From: Noah Lavine <noah.b.lavine@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Paul Eggert <eggert@cs.ucla.edu>,
Andreas Schwab <schwab@linux-m68k.org>,
Emacs development discussions <Emacs-devel@gnu.org>
Subject: Re: (0 <= i && i < N) is not "backwards"
Date: Mon, 25 Mar 2013 10:58:28 -0400 [thread overview]
Message-ID: <CA+U71=OWrZ85Kkvg1ECHL8QrP6XBfsc2WUm+1NsFX=-Y=3va5A@mail.gmail.com> (raw)
In-Reply-To: <83obe71qew.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2022 bytes --]
Hello,
To continue a tangent, if adding an explicit isnan() makes the code run any
slower, I think you should file a bug with GCC to get that fixed.
In general, I really dislike the idea of adjusting coding style to work
around a compiler's limitations. If the compiler is broken, I think it's
best to fix it and move on.
Thanks,
Noah Lavine
On Mon, Mar 25, 2013 at 10:53 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Mon, 25 Mar 2013 07:35:51 -0700
> > From: Paul Eggert <eggert@cs.ucla.edu>
> > CC: schwab@linux-m68k.org, Emacs-devel@gnu.org
> >
> > On 03/25/2013 01:20 AM, Eli Zaretskii wrote:
> >
> > > Out of fairness, you introduced this style into Emacs sources
> >
> > I've certainly used it in the changes I made, and as a result it's
> > become more popular, but I did not introduce it. That style has
> > been used in Emacs, as a minority style, for many years.
>
> AFAIR, it was once a negligible minority at best, so much so that I
> don't remember it being used. That was in the days that the only
> style enforced in the Emacs sources was what the GNU Coding Standards
> say, btw. That's what allowed "minority styles" in the first place.
>
> > > If we want our code to be robust in the face of NaNs, we should
> > > probably use 'isnan' explicitly
> >
> > That will slow the code down and make it harder to read.
>
> I disagree; there's nothing unclear in a call to isnan, and the
> slow-down is negligible, if it exists at all, and won't be noticed in
> the context of Emacs, which doesn't pretend to be a fast
> number-cruncher anyway.
>
> > Perhaps a
> > comment could be introduced; but must we really add a comment
> > "watch out for NaNs!" every time we have a floating point comparison?
>
> Such comments would be even worse.
>
> But the problem with relying on 0 < foo is that most people won't even
> consider the subtle difference between that and !(foo >= 0) when NaNs
> are involved. Calling isnan makes that explicit.
>
> Anyway, this issue is tangential to the style issue.
>
>
[-- Attachment #2: Type: text/html, Size: 2834 bytes --]
next prev parent reply other threads:[~2013-03-25 14:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-24 23:14 (0 <= i && i < N) is not "backwards" Paul Eggert
2013-03-24 23:53 ` Pascal J. Bourguignon
2013-03-25 14:23 ` Stefan Monnier
2013-03-25 14:59 ` Andreas Schwab
2013-03-25 8:20 ` Eli Zaretskii
2013-03-25 14:35 ` Paul Eggert
2013-03-25 14:53 ` Eli Zaretskii
2013-03-25 14:58 ` Noah Lavine [this message]
2013-03-25 15:09 ` Eli Zaretskii
2013-03-25 15:28 ` Noah Lavine
2013-03-25 16:49 ` Paul Eggert
2013-03-25 16:59 ` Eli Zaretskii
2013-03-30 21:45 ` Jim Meyering
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='CA+U71=OWrZ85Kkvg1ECHL8QrP6XBfsc2WUm+1NsFX=-Y=3va5A@mail.gmail.com' \
--to=noah.b.lavine@gmail.com \
--cc=Emacs-devel@gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
--cc=schwab@linux-m68k.org \
/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.