|Subject:||Re: (0 <= i && i < N) is not "backwards"|
|Date:||Mon, 25 Mar 2013 10:58:28 -0400|
> Date: Mon, 25 Mar 2013 07:35:51 -0700
> From: Paul Eggert <address@hidden>
> CC: address@hidden, address@hidden
>AFAIR, it was once a negligible minority at best, so much so that I
> 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.
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.
I disagree; there's nothing unclear in a call to isnan, and the
> > 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.
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
Such comments would be even worse.
> 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?
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.
|[Prev in Thread]||Current Thread||[Next in Thread]|