bad.t (PDL-2.074) | : | bad.t (PDL-2.075) | ||
---|---|---|---|---|
skipping to change at line 268 | skipping to change at line 268 | |||
is( $x->at, 'BAD', 'at() returns BAD for a bad value with non-default badvalue' ); | is( $x->at, 'BAD', 'at() returns BAD for a bad value with non-default badvalue' ); | |||
is( $x->sclr, 4, 'sclr() ignores bad value' ); | is( $x->sclr, 4, 'sclr() ignores bad value' ); | |||
$x = pdl(0.5,double->badvalue,0); | $x = pdl(0.5,double->badvalue,0); | |||
$x->badflag(1); | $x->badflag(1); | |||
$y = bessj0($x); | $y = bessj0($x); | |||
is( PDL::Core::string( isbad($y) ), "[0 1 0]", "bessj0()" ); | is( PDL::Core::string( isbad($y) ), "[0 1 0]", "bessj0()" ); | |||
$x = pdl(double->badvalue,0.8); | $x = pdl(double->badvalue,0.8); | |||
$x->badflag(1); | $x->badflag(1); | |||
$y = bessjn($x,3); # thread over n() | $y = bessjn($x,3); # broadcast over n() | |||
is( PDL::Core::string( isbad($y) ), "[1 0]", "thread over bessjn()" ); | is( PDL::Core::string( isbad($y) ), "[1 0]", "broadcast over bessjn()" ); | |||
ok( abs($y->at(1)-0.010) < 0.001 ); | ok( abs($y->at(1)-0.010) < 0.001 ); | |||
$x = pdl( 0.01, 0.0 ); | $x = pdl( 0.01, 0.0 ); | |||
$x->badflag(1); | $x->badflag(1); | |||
ok( all( abs(erfi($x)-pdl(0.00886,0)) < 0.001 ), "erfi()" ); | ok( all( abs(erfi($x)-pdl(0.00886,0)) < 0.001 ), "erfi()" ); | |||
# I haven't changed rotate, but it should work anyway | # I haven't changed rotate, but it should work anyway | |||
$x = byte( 0, 1, 2, 4, 5 ); | $x = byte( 0, 1, 2, 4, 5 ); | |||
$x->setbadat(2); | $x->setbadat(2); | |||
is( PDL::Core::string( $x->rotate(2) ), "[4 5 0 1 BAD]", "rotate()" ); | is( PDL::Core::string( $x->rotate(2) ), "[4 5 0 1 BAD]", "rotate()" ); | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |