Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 having an uproarious good time at the Monastery: (8)
As of 2015-08-04 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (74 votes), past polls