(j3.2006) (SC22WG5.4149) [Fwd: [WG2.5] [Fwd: NaN question]]

Van Snyder Van.Snyder
Mon Feb 1 21:31:35 EST 2010

Questions by Bertrand Meyer, forwarded from IFIP WG 2.5.  Can J3 or WG5
members help?

-------- Forwarded Message --------
From: Ronald Boisvert <boisvert at nist.gov>
To: wg25 at nsc.liu.se <wg25 at nsc.liu.se>
Subject: [WG2.5] [Fwd: NaN question]
Date: Mon, 1 Feb 2010 18:22:39 -0800

I don't really know the rationale for some of these choices.
Can some WG 2.5 member hsed some light?


-------- Original Message --------
Subject: 	NaN question
Date: 	Mon, 1 Feb 2010 21:04:24 -0500
From: 	Bertrand Meyer <Bertrand.Meyer at inf.ethz.ch>
To: 	Boisvert, Ronald F. <ronald.boisvert at nist.gov>
CC: 	Emmanuel STAPF <manus at eiffel.com>

Dear Ronald:

I hope you won't mind my asking a technical question, which maybe some 
2.5 member can answer. We are fairly na?ve about numerical programming, 
so don't be surprised if this is trivial. We couldn't find an obvious 
answer just by looking around.

The question is about the rationale behind a design choice in IEEE 754. 
Why is NaN not equal to NaN? It makes sense that x # NaN = NaN for any 
arithmetic operator #, but for equality this seems far less justified. 
Perhaps in three-valued logic NaN = NaN would be NaN, but with only two 
values True seems a more reasonable answer than False.

This is the semantics that large-scale Eiffel users want and we are in 
the process of implementing it, at least as an option, but we are 
wondering whether we are completely off the mark.

A related question is the value of x < NaN; here it does not seem 
unreasonable to take the convention that NaN is larger than anything else.

If you or one of your colleagues can shed some light on the issue we 
will be most grateful.

With best regards,

-- Bertrand Meyer

wg25 mailing list
wg25 at lists.nsc.liu.se

More information about the J3 mailing list