[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (0 <= i && i < N) is not "backwards"
From: |
Paul Eggert |
Subject: |
Re: (0 <= i && i < N) is not "backwards" |
Date: |
Mon, 25 Mar 2013 09:49:28 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
On 03/25/13 07:53, Eli Zaretskii wrote:
> the problem with relying on 0 < foo is that most people won't even
> consider the subtle difference between that and !(foo >= 0)
There must be dozens of places in the Emacs source code that
use floating-point comparisons and rely on NaNs behaving the
way that they do. It'd be unnecessary clutter to add comments
and/or isnan() calls to them all. Sure, we could modify our
compilers (and this would include the Emacs Lisp compiler)
to recognize and optimize-away the isnan calls, but that would
be even more make-work. Programmers who deal with
floating-point should be cognizant of NaNs; that's just
life in the floating-point big city these days.
Re: (0 <= i && i < N) is not "backwards", Jim Meyering, 2013/03/30