Re: Interesting behavior of double.NaN

Marc Brooks <[email protected]> Mon, 23 Mar 2009 12:36:30 -0500
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <[email protected]>
In the IEEE standard (that all modern runtimes including .Net are
based), a NaN is both equal AND not-equal to a NaN.  The makes sense
if that you can check if it is a NaN by equality and also will not be
misled when you don't expect a NaN and get one in a comparison (as a
NaN is not-equal to ANYTHING).

I've coded for that very eventuality in my Fraction class, we're you
can also see all the pain that goes into being a conformant .Net
mathematical value-type.  If there is any interest, I'll plop it on
CodePlex sometime.

-- 
Marc C. Brooks
http://musingmarc.blogspot.com

NOT sent from an iPhone

===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives