C++: Comparing list of doubles with some invalid values (QNAN)
- by J.M.
Hello,
i need to compare two std::list < double , but some doubles may be invalid numbers (QNAN).
If any invalid numbers are list entries the compare process won't work, because a comparison of the same invalid value will always result in 'false'.
What is the easiest and most elegant way to solve the problem?
My idea was to create copies of both lists, iterate through them and remove invalid values and then compare the remaining lists. The lists will typically have 20-50 values in them. Is there a more resource friendly way to solve it?