Skip to content

Commit

Permalink
Make pow with negative integer exponent be differentiable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Ekstrom committed Oct 26, 2010
1 parent 985fe24 commit 6e70bd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/taylor/taylor_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static taylor<T,Nvar,Ndeg> pow(const taylor<T,Nvar,Ndeg> &t, int n)
}
else if (n < 0)
{
return pow(t,double(n));
return 1/pow(t,-n);
}
else
{
Expand Down

0 comments on commit 6e70bd3

Please sign in to comment.