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

Loren P Meissner lpmeissner
Tue Feb 2 00:17:38 EST 2010

I seem to vaguely remember, a rationale was: when in doubt, return something
that will get the user?s attention.

Loren P Meissner
(Have you ever imagined a world without hypothetical situations?)

From: j3-bounces at j3-fortran.org [mailto:j3-bounces at j3-fortran.org] On Behalf
Of Van Snyder
Sent: Monday, February 01, 2010 6:32 PM
To: sc22wg5
Subject: (j3.2006) (SC22WG5.4149) [Fwd: [WG2.5] [Fwd: NaN question]]

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

J3 mailing list
J3 at j3-fortran.org

More information about the J3 mailing list