in reply to Re: A new golf challenge - Natural Sorting
in thread A new golf challenge - Natural Sorting

Forget golf, it doesn't even work. <=> will fail for 865314457646576532325988.

Replies are listed 'Best First'.
Re^3: A new golf challenge - Natural Sorting
by QM (Parson) on Mar 17, 2006 at 15:08 UTC
    Which means that a solution more robust than <=> will have to compare numbers using arbitrary precision (and that just pushes the threshold a few orders of magnitude farther out). Which means that numbers will have to be recognized as such, so that -123.4e-45.6E789 would not be taken as a single number, but -123.4e-456 will be. And then we get into whether whitespace, underscores, and commas/decimals (depending on locale) are allowed, and what they mean.

    It's a long tee shot, onto a glacier, and only transparent golf balls are available.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

Re^3: A new golf challenge - Natural Sorting
by jdporter (Paladin) on Mar 17, 2006 at 14:55 UTC
    Ouch. ;-)