Added support for negative powers in algo
This commit is contained in:
parent
c1f1cf5a38
commit
ada4626131
2 changed files with 5 additions and 0 deletions
|
@ -25,6 +25,10 @@ namespace CosmoTool
|
|||
template<typename T>
|
||||
static T spower(T a)
|
||||
{
|
||||
if (N<0)
|
||||
{
|
||||
return 1/SPowerBase<-N>::spower(a);
|
||||
}
|
||||
if ((N%2)==0)
|
||||
{
|
||||
T b = SPowerBase<N/2>::spower(a);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue