Badflag is not being propagated to result when using .=. PDL::Ops::assgn has had this functionality removed due to complications in the Core (cf. Doug Burke).
use PDL;
print 'Bad status = ', $PDL::Bad::Status, "\n"; # 'Bad status = 1'
print 'Using badval = ', double->badvalue, "\n"; # Using badval = -1.79769313486232e+308
$a = sequence(double,10);
$b = zeroes(double,10,2);
my $mask = $a >= 6;
$b->slice(':,(1)') .= $a->setbadif($mask);
print $b, "\n", 'badflag = ', $b->badflag();
#OUTPUT
#*******************************************************************************************************************************************************
#[
# [ 0 0 0 0 0 0 0 0 0 0]
# [ 0 1 2 3 4 5 -1.7976931e+308 -1.7976931e+308 -1.7976931e+308 -1.7976931e+308]
#]
#
# badflag = 0
Further details are in the mailing list. http://mailman.jach.hawaii.edu/pipermail//pdl-porters/2012-July/004891.html
Thanks.
- Tim
As the comments in the code suggest, I am no longer 100% sure why this restriction holds (or if it still does). I support the idea of trying to remove the restriction on a branch and seeing what tests break, after adding in some tests of the new behavior.
Lower priority. Not planned for PDL-2.008
What is the status of this fix and is it ready for inclusion in PDL-2.014?
This matter will now be tracked at https://github.com/PDLPorters/pdl/issues/29