in reply to Re^2: Sorting through a rollover
in thread Sorting through a rollover

Or slightly more compactly (using trinary math instead of the trinary operator):
(abs($a - $b) <=> $max_spread) * ($b <=> $a)
where $max_spread is the maximum range you expect your numbers to cover before wrapping. 50_000 might be a better choice than 200.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^4: Sorting through a rollover
by RazorbladeBidet (Friar) on Feb 10, 2005 at 20:40 UTC
    The 200 was based upon the fact that he's showing 200 messages.

    either way, I think as long as it's less than the possible number of id's, it'll be ok

    (or maybe less than half?)