saxbophone / tr-sort

Transpose-Sort —why sort numbers with comparisons when we can calculate their rough sort positions instead?
https://saxbophone.com/tr-sort
2 stars 0 forks source link

Sorting real values: Add tests for input containing NaN and other special values #6

Closed saxbophone closed 3 years ago

saxbophone commented 3 years ago

Because it's a calculated sort, there is a moderate to high chance this will cause incorrect results.

If this is the case, we can decide to either modify the sort to work on these types of value, or declare them unsortable.

saxbophone commented 3 years ago

Apparently, sorting on input containing NaN is out of scope (the existing C++ stdlib sorting functions probably don't support it). I suppose this makes sense due to the behaviour of NaN with the comparison operators.