Hello,
When we use the minmax function and all the numbers are the same (min and max must be the same), it returns only the min (max is undef) in some cases.
We have found an example that shows the issue:
use warnings;
use utf8;
use List::MoreUtils qw(minmax);
use Data::Dumper;
use Devel::Peek;
my $valores = [ map { sprintf("%s", 0) } (1..2) ];
my ( $min, $max ) = minmax( map { $_ } @$valores );
print Dumper([$min, $max]);
my @resultados = minmax( map { $_ } @$valores );
print Dumper(\@resultados);
We get:
```$ perl /tmp/test.pl
$VAR1 = [
0,
undef
];
$VAR1 = [
0,
0
];
If we force to use the PP version (pure perl) it works correctly:
```$ export LIST_MOREUTILS_PP=1
$ perl /tmp/test.pl
$VAR1 = [
0,
0
];
$VAR1 = [
0,
0
];```
So if we have an intermediate copy, surprisingly it works.
Hello,
When we use the minmax function and all the numbers are the same (min and max must be the same), it returns only the min (max is undef) in some cases.
We have found an example that shows the issue: