Order two numerical lists: Difference between revisions

Content added Content deleted
(→‎{{header|Pike}}: can also convert to unicode strings.)
Line 160: Line 160:
}</lang>
}</lang>
Pikes <code>Array.sort_array()</code> function can sort an array of arrays using the <code><</code> operator, but it will sort longer arrays before shorter ones. Therefore the above function is still needed if the intent is to use the comparison for a sort operation.
Pikes <code>Array.sort_array()</code> function can sort an array of arrays using the <code><</code> operator, but it will sort longer arrays before shorter ones. Therefore the above function is still needed if the intent is to use the comparison for a sort operation.

If the numbers are in 32bit signed integer range, the following works too:
<lang Pike>(string)a < (string)b;</lang>


=={{header|Python}}==
=={{header|Python}}==