Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Numeric Sorting on Characters

by sundialsvc4 (Abbot)
on Aug 14, 2013 at 20:54 UTC ( #1049476=note: print w/replies, xml ) Need Help??

in reply to Numeric Sorting on Characters

Hmmm... the presence of a single “-” seems quite suspicious to me ... have you looked at the corresponding record in the input data, and if so, is it really just a dash?   Does this look like a possible bug in the program that produced the file?   (Hey, it happens ... a lot.)

“Making the immediate bug go-away” sometimes leaves you in a situation that is much worse.   Why is that dash there?   Is it really there (or is your parsing algorithm insufficient?).   Is it really correct to code your program to detect and to accept it?   Maybe the proper answer to all 3 questions is yes.   But then again, the software might be trying to tell you something.

Replies are listed 'Best First'.
Re^2: Numeric Sorting on Characters
by halecommarachel (Sexton) on Aug 16, 2013 at 20:24 UTC

    If the cpu time is not available, I set the value to "-". It's just a way of having a placeholder than returns true if tested with an if statement.

      Still, it leads to the Zen question "How do you do a numeric sort of non-numeric data?".

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1049476]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2018-05-24 21:56 GMT
Find Nodes?
    Voting Booth?