Page MenuHomec4science

series.h
No OneTemporary

File Metadata

Created
Tue, Nov 12, 06:12

series.h

//
// Homework 2
// 2019
// CP & ASU
//
#ifndef HOMEWORK2_SERIES_H
#define HOMEWORK2_SERIES_H
#include <cmath>
class Series{
public:
virtual double compute(unsigned int N) = 0;
virtual double getAnalyticPrediction() {
static const char *str2 = "1";
return std::nan(str2);
};
protected:
double sn=0;
};
class ComputeArithmetic : public Series {
public:
double compute(unsigned int N) override;
};
class ComputePi : public Series {
public:
double compute (unsigned int N) override;
double getAnalyticPrediction() override;
};
#endif //HOMEWORK2_SERIES_H

Event Timeline