From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

nan change

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.

0 Kudos
Message 1 of 2
(2,267 Views)

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.

0 Kudos
Message 2 of 2
(2,260 Views)