Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: place floats into array

by keszler (Priest)
on Sep 19, 2013 at 18:21 UTC ( #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


Comment on Re: place floats into array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2014-10-24 15:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (132 votes), past polls