Skip to content

Commit

Permalink
Change csqrt_upper to csqrt_up
Browse files Browse the repository at this point in the history
  • Loading branch information
wlmb committed Jan 15, 2025
1 parent ced4ca8 commit 9ffc5a1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion lib/PDL/Ops.pd
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ EOF
},
);

pp_def('csqrt_upper',
pp_def('csqrt_up',
GenericTypes => $AF,
Pars => 'i(); complex [o] o()',
Doc => <<'EOF',
Expand Down
42 changes: 21 additions & 21 deletions t/ops.t
Original file line number Diff line number Diff line change
Expand Up @@ -140,32 +140,32 @@ is $pa->at(0), '16', 'sqrt orig value ok';
is_pdl($cldsqrt,cldouble($roots), "csqrt_right of cldouble");
}

{ # csqrt_upper
{ # csqrt_up
my $pi=4*atan2(1,1);
my $eiO = exp(i()*sequence(8)*$pi/4);
my $eiO2 = exp(i()*sequence(8)*$pi/8);
my $sqrt=csqrt_upper($eiO);
is_pdl($sqrt, $eiO2, "csqrt_upper of complex");
my $i=csqrt_upper(-1);
is_pdl($i, i(), "csqrt_upper of real -1");
my $sqrt=csqrt_up($eiO);
is_pdl($sqrt, $eiO2, "csqrt_up of complex");
my $i=csqrt_up(-1);
is_pdl($i, i(), "csqrt_up of real -1");
my $squares="-9 -4 -1 0 1 4 9";
my $roots="3i 2i i 0 1 2 3";
my $lsqrt=long($squares)->csqrt_upper;
is_pdl($lsqrt, cdouble($roots), "csqrt_upper of long");
my $llsqrt=longlong($squares)->csqrt_upper;
is_pdl($llsqrt, cdouble($roots), "csqrt_upper of longlong");
my $fsqrt=float($squares)->csqrt_upper;
is_pdl($fsqrt, cfloat($roots), "csqrt_upper of float");
my $dsqrt=double($squares)->csqrt_upper;
is_pdl($dsqrt,cdouble($roots), "csqrt_upper of double");
my $ldsqrt=ldouble($squares)->csqrt_upper;
is_pdl($ldsqrt, cldouble($roots), "csqrt_upper of ldouble");
my $cfsqrt=cfloat($squares)->csqrt_upper;
is_pdl($cfsqrt, cfloat($roots), "csqrt_upper of cfloat");
my $cdsqrt=cdouble($squares)->csqrt_upper;
is_pdl($cdsqrt,cdouble($roots), "csqrt_upper of cdouble");
my $cldsqrt=cldouble($squares)->csqrt_upper;
is_pdl($cldsqrt,cldouble($roots), "csqrt_upper of cldouble");
my $lsqrt=long($squares)->csqrt_up;
is_pdl($lsqrt, cdouble($roots), "csqrt_up of long");
my $llsqrt=longlong($squares)->csqrt_up;
is_pdl($llsqrt, cdouble($roots), "csqrt_up of longlong");
my $fsqrt=float($squares)->csqrt_up;
is_pdl($fsqrt, cfloat($roots), "csqrt_up of float");
my $dsqrt=double($squares)->csqrt_up;
is_pdl($dsqrt,cdouble($roots), "csqrt_up of double");
my $ldsqrt=ldouble($squares)->csqrt_up;
is_pdl($ldsqrt, cldouble($roots), "csqrt_up of ldouble");
my $cfsqrt=cfloat($squares)->csqrt_up;
is_pdl($cfsqrt, cfloat($roots), "csqrt_up of cfloat");
my $cdsqrt=cdouble($squares)->csqrt_up;
is_pdl($cdsqrt,cdouble($roots), "csqrt_up of cdouble");
my $cldsqrt=cldouble($squares)->csqrt_up;
is_pdl($cldsqrt,cldouble($roots), "csqrt_up of cldouble");
}

{ # r2C
Expand Down

0 comments on commit 9ffc5a1

Please sign in to comment.