Zakariyya Mughal
2014-11-29 07:38:38 UTC
Hi,
I was looking at the `minmax` function and I noticed that it does not
treat BAD values the same way as the `min` and `max` functions.
Code to reproduce below:
use Test::More tests => 3; use strict; use warnings; use PDL;
my $bad_0dim = pdl(q|BAD|);
is( $bad_0dim->min, 'BAD' );
is( ($bad_0dim->minmax)[0], $bad_0dim->min );
is( ($bad_0dim->minmaximum)[0], $bad_0dim->min );
which gives the following output:
1..3
ok 1
not ok 2
# Failed test at - line 6.
# got: '-1.79769313486232e+308'
# expected: 'BAD'
ok 3
# Looks like you failed 1 test of 3.
Is this intentional? The docs do not mention BAD values at all and say
(pdldoc minmax):
The two values are returned as Perl scalars similar to min/max.
Is there a way to make this follow POLA more?
Regards,
- Zaki Mughal
I was looking at the `minmax` function and I noticed that it does not
treat BAD values the same way as the `min` and `max` functions.
Code to reproduce below:
use Test::More tests => 3; use strict; use warnings; use PDL;
my $bad_0dim = pdl(q|BAD|);
is( $bad_0dim->min, 'BAD' );
is( ($bad_0dim->minmax)[0], $bad_0dim->min );
is( ($bad_0dim->minmaximum)[0], $bad_0dim->min );
which gives the following output:
1..3
ok 1
not ok 2
# Failed test at - line 6.
# got: '-1.79769313486232e+308'
# expected: 'BAD'
ok 3
# Looks like you failed 1 test of 3.
Is this intentional? The docs do not mention BAD values at all and say
(pdldoc minmax):
The two values are returned as Perl scalars similar to min/max.
Is there a way to make this follow POLA more?
Regards,
- Zaki Mughal