Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The problem that in one example $second_val is a signed floating point number like -0.0999999999, however grep matched the number to be 0.0999999999 instead so @new_array now contains different values to what I expected. Is there a different way to do this where I won't encounter this problem??my @new_array = grep {$_ == $first_val .. $_ == $second_val} @old_arra +y;
Cheers!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using grep to extract numbers from an array
by jaa (Friar) on Jul 10, 2003 at 10:28 UTC | |
|
Re: using grep to extract numbers from an array
by tommyw (Hermit) on Jul 10, 2003 at 13:01 UTC | |
|
Re: using grep to extract numbers from an array
by flounder99 (Friar) on Jul 10, 2003 at 13:21 UTC |