Skip to content

Commit

Permalink
Add tests of r2C
Browse files Browse the repository at this point in the history
  • Loading branch information
wlmb authored and mohawk2 committed Jan 16, 2025
1 parent c2cc6e4 commit 89d5b51
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/ops.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use PDL::LiteF;
use Config;
kill 'INT',$$ if $ENV{UNDER_DEBUGGER}; # Useful for debugging.
use Test::Exception;
use Test::PDL;
require PDL::Core::Dev;

kill 'INT',$$ if $ENV{UNDER_DEBUGGER}; # Useful for debugging.
Expand Down Expand Up @@ -111,6 +112,17 @@ if ($can_complex_power) {
is $pa->at(0), '16', 'sqrt orig value ok';
}

{
is_pdl(r2C(long(1)), cdouble(1), "r2C of long");
is_pdl(r2C(longlong(1)), cdouble(1), "r2C of longlong");
is_pdl(r2C(float(1)), cfloat(1), "r2C of float");
is_pdl(r2C(double(1)), cdouble(1), "r2C of double");
is_pdl(r2C(ldouble(1)), cldouble(1), "r2C of ldouble");
is_pdl(r2C(cfloat(1)), cfloat(1), "r2C of cfloat");
is_pdl(r2C(cdouble(1)), cdouble(1), "r2C of cdouble");
is_pdl(r2C(cldouble(1)), cldouble(1), "r2C of cldouble");
}

{
my $pa = pdl 1,0;
my $pb = ! $pa;
Expand Down

0 comments on commit 89d5b51

Please sign in to comment.