Skip to content

Commit

Permalink
Devel::Cover causes retval of ->{inv} to be wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Sep 15, 2020
1 parent 85a8ffb commit 88ec767
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/PDL/Transform/Color.pm
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ sub t_gamma {
if($opt->{gamma} != 1) {
$out *= ($in->abs + ($in==0)) ** (1.0/$opt->{gamma} - 1);
}
$out;
};

$me;
Expand Down
3 changes: 2 additions & 1 deletion t/color.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ is $@, '', "t_gamma transform applied OK";
ok(all(($otriplet * 10000)->rint == ($itriplet**2 * 10000)->rint), "gamma=2 squares the output");
eval {$otriplet = $itriplet->invert($t);};
is $@, '', "t_gamma transform inverse applied OK";
ok(all(($otriplet * 10000)->rint == ($itriplet**0.5 * 10000)->rint), "gamma=2 inverse square-roots the output");
ok all((($otriplet * 10000)->rint) == (($itriplet**0.5 * 10000)->rint)), "gamma=2 inverse square-roots the output"
or diag explain [ unpdl($otriplet), unpdl($itriplet) ];

$itriplet *= pdl(-1,1,1);
eval {$otriplet = $itriplet->apply($t);};
Expand Down

0 comments on commit 88ec767

Please sign in to comment.