"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/nat_complex.t" between
PDL-2.078.tar.gz and PDL-2.079.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

nat_complex.t  (PDL-2.078):nat_complex.t  (PDL-2.079)
skipping to change at line 133 skipping to change at line 133
$z **= 2; $z **= 2;
ok(tapprox($z, i2C(0)), 'check that 0 +0i exponentiates correctly'); # Wasn't always so. ok(tapprox($z, i2C(0)), 'check that 0 +0i exponentiates correctly'); # Wasn't always so.
my $r = r2C(-10); my $r = r2C(-10);
$r **= 2; $r **= 2;
ok(tapprox($r, r2C(100)), ok(tapprox($r, r2C(100)),
'check that imaginary part is exactly zero') # Wasn't always so 'check that imaginary part is exactly zero') # Wasn't always so
or diag "got: ", $r; or diag "got: ", $r;
} }
my $asin_2 = PDL::asin(2).""; my $asin_2 = PDL::asin(2)."";
like $asin_2, qr/nan/i, 'perl scalar 2 treated as real'; my $nan_re = qr/nan|ind/i;
like $asin_2, $nan_re, 'perl scalar 2 treated as real';
$asin_2 = PDL::asin(2.0).""; $asin_2 = PDL::asin(2.0)."";
like $asin_2, qr/nan/i, 'perl scalar 2.0 treated as real'; like $asin_2, $nan_re, 'perl scalar 2.0 treated as real';
$asin_2 = PDL::asin(byte 2).""; $asin_2 = PDL::asin(byte 2)."";
like $asin_2, qr/nan/i, 'real byte treated as real'; like $asin_2, $nan_re, 'real byte treated as real';
$asin_2 = PDL::asin(double 2).""; $asin_2 = PDL::asin(double 2)."";
like $asin_2, qr/nan/i, 'real double treated as real'; like $asin_2, $nan_re, 'real double treated as real';
$asin_2 = PDL::asin(pdl 2).""; $asin_2 = PDL::asin(pdl 2)."";
like $asin_2, qr/nan/i, 'pdl(2) treated as real'; like $asin_2, $nan_re, 'pdl(2) treated as real';
if (PDL::Core::Dev::got_complex_version('asin', 1)) { if (PDL::Core::Dev::got_complex_version('asin', 1)) {
my $c_asin_2 = PDL::asin(cdouble(2)).""; my $c_asin_2 = PDL::asin(cdouble(2))."";
unlike $c_asin_2, qr/nan/i, 'asin of complex gives complex result'; unlike $c_asin_2, qr/nan/i, 'asin of complex gives complex result';
} }
{ {
# Check stringification of complex ndarray # Check stringification of complex ndarray
my $c = 9.1234 + 4.1234*i(); my $c = 9.1234 + 4.1234*i();
like($c->dummy(2,1).'', qr/9.123.*4.123/, 'stringify native complex'); like($c->dummy(2,1).'', qr/9.123.*4.123/, 'stringify native complex');
} }
 End of changes. 5 change blocks. 
5 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)