01-04-2012 04:49 PM
I just upgraded from 2009 to 2011.
I see there has been a change in the handling of Float NaN values. When using the U cast, Nan used to convert to 0. Now it converts to 255.
Is this observation correct, and what is the best way to handle this change. The conversion is being used to generate a RGB value.
This is old code, so changing it to be more robust is not an issue.
01-04-2012 05:13 PM
Your observation is correct. Since you are relying on undocumented behavior of an ill-defined conversion I would recommend adding an explicit check using the Not a Number? comparison fed into a Case Structure or Select function. In this way you can define the mapping of NaN to U8 in such a way that it will not be affected by the whims of NI.