Page MenuHomec4science

Series.cc
No OneTemporary

File Metadata

Created
Sat, Nov 9, 02:26

Series.cc

#include "Series.hh"
double Series::getAnalyticPrediction()
{
return(numeric_limits<double>::quiet_NaN());
}
ComputeArithmetic::ComputeArithmetic()
{
value=0;
iter=1;
}
double ComputeArithmetic::compute(unsigned int N)
{
for(int i=iter;i<N+1;i++)
{
value+=i;
iter=i+1;
}
//iter=N+1;
return(value);
}
ComputePi::ComputePi()
{
value=0;
iter=1;
}
double ComputePi::compute(unsigned int N)
{
for(int i=iter;i<N+1;i++)
{
value+=6.0/i/i;
iter=i+1;
}
//iter=N+1;
return(sqrt(value));
}
double ComputePi::getAnalyticPrediction()
{
return(M_PI);
}

Event Timeline