Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that simply testing for the presence of the first number returns negative, even though printing out the number and the array suggest they should definately match. Can anyone please help?
my $first_num = $highest[0]; # print $first_nums gives 0.743499999999 +99 for (my $i=0; $i < @array; $i++) { if ($first_num) { if ($array[$i] == $first_num) { print "FOUND! \n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting numbers from arrays
by BrowserUk (Patriarch) on Jun 30, 2003 at 14:17 UTC | |
|
Re: Extracting numbers from arrays
by dragonchild (Archbishop) on Jun 30, 2003 at 13:09 UTC | |
|
Re: Extracting numbers from arrays
by davorg (Chancellor) on Jun 30, 2003 at 13:10 UTC | |
by Abigail-II (Bishop) on Jun 30, 2003 at 13:55 UTC | |
|
Re: Extracting numbers from arrays
by Skeeve (Parson) on Jul 01, 2003 at 06:49 UTC |