> I need to compare two big arrays of double which may contain items set
> to not-a-number (NaN).
> When both arrays contain NaN items, the comparison should yield
> "equal" if all NaN elements are placed at the same index position and,
The equals node in LV act the way it does because that is the way IEEE
defines it. The string comparison is a good idea, but most of the time
is being spent converting the data into a string and possibly swapping
bytes.
Another approach, that will probably be faster is to do a simple
comparison first, but when it returns false, look at the elements that
are FALSE and see if both are NaNs. If there aren't that many NaNs, it
should go pretty quick. To get the more detailed equals data, popup on
the equals node and turn
on Compare Aggregates. This will now return an
array of Booleans instead of a single one. You can either loop through
or search for FALSE. The index returned can be used to index the input
elements and see if they are both NaN using the IsNan function.
Of course if you want to use a DLL and C code to do the comparison, that
will work too and will probably be even faster.
Greg McKaskle