I don't recall the details. But I think we let a NaN be EQ to itself, but not EQL or =. Since they were never supposed to be = to anything, even themselves, we decided to print them unreadably. I don't think we printed anything to distinguish different values, since that would kind of go against the idea that they have no identity.


On Nov 3, 2018 10:49 AM, Pascal Bourguignon <pjb@informatimago.com> wrote:


On 3 Nov 2018, at 13:26, Antoniotti Marco <antoniotti.marco@disco.unimib.it> wrote:



On Nov 3, 2018, at 24:54 , Bob Cassels <bobcassels@netscape.net> wrote:

Of course they are represented internally the same way other floating point values are.

Are you asking how to print those values? (Print -0.0 like that. Print + and - infinity some way they can be read by the reader. Preferably some way that's not otherwise a legal token. Probably print NaNs using the #unreadable syntax. I don't remember how that works. I don't remember what we did at Symbolics, even though I'm probably the one who did it. I can ask around, if you care.) Or something else?

Thank you.

I do not really care about printing and reading NaNs and it looks like most implementations do read and write IEEE infinities.

Th problem is that ANSI does not talk about infinities and NaNs, so the issue I have is what to do with them in a “portable” library (YMMV).

I was toying with the idea of using symbolic constants for infinities, but it looks like using IEEE infinities directly is a better - and simpler - way to follow.

Note that there are a big number of NANs.  If you want to print them readably, you definitely need a syntax able to deal with all of them, not just a couple of infinities.


-- 
__Pascal J. Bourguignon__