[Top][All Lists]

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

Re: Using the GNU GMP Library for Bignums in Emacs

From: Ken Raeburn
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Sun, 22 Jul 2018 08:06:02 -0400

On Jul 18, 2018, at 06:20, Paul Eggert <address@hidden> wrote:
> Stefan Monnier wrote:
>> I recently posted a patch which makes EQ behave like `eql` attached.
>> I just tried to see its impact on the ELisp compilation time
>> (i.e. I did `rm **/*.elc; make`).
> I tried to reproduce this on my machine, and ran into some trouble (the code 
> had warnings that caused compilation to fail). Although your patch is 
> evidently intended only as a quick benchmark and not as an actual change, I 
> worry that the benchmark isn't realistic enough, as some usage of EQ in C 
> code will need to change to Feql or equivalent. Also, the C code will need to 
> change how hashing works since XHASH etc. must be consistent with eq.
> Looking into this a bit more, I discovered that eql currently operates 
> incorrectly on NaNs, as it's inconsistent with how hash tables work. I 
> installed the attached patch into master to fix that.

If we’re going to treat NaNs as having distinguishable bit patterns so we can 
tell whether two are the same or not, should we also have printable/readable 
forms that distinguish them? If not, how do we create and use distinguishable 

For that matter, are we guaranteed that operations like (/ 0.0 0.0) will always 
generate NaNs with the same bit pattern?

I would’ve guessed that it might be preferable to go the other direction, and 
use one canonical NaN value in Lisp, which would thus always be eq/eql to all 
other NaN expressions.


reply via email to

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