<HTML>
<HEAD>
<TITLE>Re: [vtk-developers] Adding IsNan() to vtkMath</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Brad,<BR>
<BR>
The source code you sent has as one of its cases a check of the bits of an IEEE-754 number. I see that vtkMath already has a Nan function that returns an IEEE NaN. If VTK is only supporting IEEE-754 in the first place, is there any problem with just performing the bit check?<BR>
<BR>
-Ken<BR>
<BR>
<BR>
On 7/20/09 3:40 PM, "Brad King" <<a href="brad.king@kitware.com">brad.king@kitware.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Moreland, Kenneth wrote:<BR>
> int vtkMath::IsNan(double x)<BR>
> {<BR>
> return isnan(x);<BR>
> }<BR>
><BR>
> Does anyone know any portability issues with this?<BR>
<BR>
Getting this to work everywhere (not just compile) is somewhat<BR>
involved. The vxl folks have code here:<BR>
<BR>
<a href="http://vxl.svn.sourceforge.net/viewvc/vxl/trunk/core/vnl/vnl_math.cxx?revision=24028&view=markup">http://vxl.svn.sourceforge.net/viewvc/vxl/trunk/core/vnl/vnl_math.cxx?revision=24028&view=markup</a><BR>
<BR>
Note that there should be overloads for float, double, and<BR>
perhaps long double.<BR>
<BR>
-Brad<BR>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>