Not to go off on too much of a tangent, but isn't NaN unorderable? Its
greater than nothing, and less than nothing, so you can't even really sort a
list with a NaN value in it (..though I'm sure python does sort it by some
metric for practical reasons) - it would be impossible to find a NaN with a
binary search... it would be impossible to have a NaN in an ordered sequence
.... wouldn't it?
-----Original Message-----
From: Cameron Simpson
Perhaps a math.hasnan() function for collections could be implemented with binary search?
math.hasnan(seq)
Why would a binary search be of use? A staraight sequential scan of the
sequence seems the only reliable method. Binary search is for finding a
value in an ordered sequence.
Cheers,
Cameron Simpson