baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:
all numbers are 10x larger or smaller then any other number in the group(i cannot even express myself correctly). What i need is to place them in the array depending on how meny decimal places they occupy given that if they are > 1 the an ofset by the largest number has to be takon in considereation:1.3e-3 3.7e-5 102 46 1e-4 1e-12
table was updated $a[2] was missing , sorry, thnx choroba !!
how do i do this without using those chaines of if-else blocks$a[0] = 102; #1e2 $a[1] = 46; #1e1 $a[2] = 0; #1e0 $a[3] = 0; #1e-1 $a[4] = 0; #1e-2 $a[5] = 1.3e-3#1e-3 $a[6] = 1e-4 #1e-4 $a[7] = 1e-5 #1e-5 ... $a[14] = 1e-12 #1e-12
thnx
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: place floats into array (Corrected.)
by BrowserUk (Patriarch) on Sep 19, 2013 at 18:25 UTC | |
by keszler (Priest) on Sep 19, 2013 at 18:32 UTC | |
|
Re: place floats into array
by Perlbotics (Archbishop) on Sep 19, 2013 at 18:37 UTC | |
|
Re: place floats into array
by Anonymous Monk on Sep 19, 2013 at 23:10 UTC | |
|
Re: place floats into array
by keszler (Priest) on Sep 19, 2013 at 18:21 UTC | |
|
Re: place floats into array
by choroba (Cardinal) on Sep 19, 2013 at 18:20 UTC |