emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bignum branch


From: Stefan Monnier
Subject: Re: bignum branch
Date: Wed, 18 Jul 2018 16:41:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> NaN (specifically of the IEEE754 variety) is supposed to compare
> non-equal even when compared to itself.

There's "compare" and there's "compare".
I think we always want (eql x x) to return t, so the above behavior
makes a lot of sense.  The rule that NaN is not equal to itself should
only be applied when doing a numerical comparison (i.e. (= x x) may
return nil).

> I recognize that eql is used in the above, but that would probably
> still create two LISP objects that happen to have the same value, but
> the established FP math says these two values should not compare equal
> anyway.  If you stray from that convention there should be a really
> good reason for that and it needs to be prominently documented.

NaNs are a minefield.  I understand there are good reasons for this
minefield, but it's good practice to try and confine the pain to those
places where it is indispensable.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]