in reply to Re: sorting scientific numbers
in thread sorting scientific numbers
This is somewhat tangetial, but in a numerical context perl will coerce any string that begins with something recognizable as a number into a number. That's why "0 but true" is a perfectly good1 "true zero." See Is '2x' + '3y' == 5 documented? and the man page for the C atof function.
1Well, not quite. As it turns out '0 but true' has a "special dispensation" that disables the warnings that perl would have otherwise have generated. E.g.:% perl -wle 'print "OK" if "0 but true" < 1' OK % perl -wle 'print "OK" if "0 but righteous" < 1' Argument "0 but righteous" isn't numeric in numeric lt (<) at -e line +1. OK
the lowliest monk
|
|---|