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.
I was reading up on some SQL the other day, and the author made a clear point that "variable = NULL" by design returns a different result than "variable IS NULL". LabVIEW may have been designed with the same concept - it's impossible to assign comparison equality or inequality to Not a Number. Comments from R&D?
Laura, if it is alright with Cthulhu, I would suggest the title of this post be changed to "Include a binary mode option for the comparison 'Equal' and 'Not Equal'" for better searching (it took me a while to realize egal=equal).
And that's precisely the point. As noted, NaN is not supposed to be used for equality operations. The IEEE standaard that tst alludes to is IEEE754. It states that NaN=NaN always returns false. Further, according to the spec, NaN can actually have a sign, but it has no meaning other than just diagnostics.
Also note that a binary comparison of NaNs can easily fail, because the Mantissa can be arbitrary as long as it is not zero. This means we can have 2^52-1 different NaN and any comparison is meaningless.
I know the function "Is NaN/Path/Refnum", but when you have the value 'NaN' in a cluster or in any complex struct, it is not esay to use. So to make a test if the value change, you have only the choice to compare the Flattened to string data.
Well, even using Flatten To String is not guaranteed to work because NaN is so special. As noted by altenbach, and as detailed in the IEE754 spec I linked to earlier, NaN is only defined by the exponent being a specific pattern. The "fraction" part can be any non-zero value. Thus, a Flatten to String would give you 2^32 - 1 possible flattened values for SGL and 2^52 - 1 possible flattened values for DBL. If you need to do that kind of comparison then you should use Inf or -Inf since the bit pattern for those values is clearly defined.
Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.