You can't really distinguish @nums which round to the same. If you need to tell them apart, don't round them. Ignoring that problem, you can construct a hash of short_nums to nums,
That construction makes the last occurence of nearly equal @nums be returned.my %unround; @unround{@short_nums} = @nums; my @new_array = map {$unround{$_}} grep {exists $unround{$_}} @found;
After Compline,
Zaxo
In reply to Re: testing for numerical equality
by Zaxo
in thread testing for numerical equality
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |