Added support for negative powers in algo

This commit is contained in:
Your Name 2012-06-05 16:41:55 -04:00
parent c1f1cf5a38
commit ada4626131
2 changed files with 5 additions and 0 deletions

View file

@ -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);