Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: place floats into array

by keszler (Priest)
on Sep 19, 2013 at 18:21 UTC ( [id://1054895]=note: print w/replies, xml ) Need Help??


in reply to place floats into array

use strict; use warnings; my @a = qw( 1.3e-3 3.7e-5 102 46 1e-4 1e-12 ); # force array element evaluation as numeric before sort $_ += 0 for @a; print $_,$/ for sort { $a <=> $b } @a; __END__ 1e-12 3.7e-05 0.0001 0.0013 46 102

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1054895]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-23 19:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found