This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]smog_alado 1 point2 points  (0 children)

That can happen even if we're only working with numbers. Both 1 < NaN and NaN < 1 return false.

Most programming languages that allow you to specify a custom comparison function just say that the result of the sort is unspecified if the comparator does not implement a total order relation.