by charliesome · 7y ago · 0 comments
You've mentioned NaN propagation in another comment and I think that's a perfect example of the problem with this approach. Sorting a vector of arbitrary floats is a notoriously thorny problem because any float could be NaN, and as NaN is incomparable to any other float, there is no total ordering of floats. There is no general solution to this problem that doesn't involve making assumptions that could be faulty for some applications.
There are sensible answers. But they are weird.
I would say let an INVALID string be length 0. Then accept that catting a valid and invalid string would result in a shorter length.
Which one do you think is safer?
I understand how one could shoot down implementations, but none has made a convincing argument about shooting down the idea.