Re:Popular Myths about C++, Part 3
by ridiculous_fish on Tuesday December 23, 2014 @12:15AM
(#8786869)
Actually I would say it was rather careless, because it mishandles NaNs:
In my test this leaves the vector unchanged, which is definitely not in decreasing order.
[ Parent
| on HN ]
">" does not form a total order on doubles if you include NaN, so that's not really suprising. That is, you're providing a comparison function which is invalid, you should (at best) expect invalid results.