添加项目文件。
This commit is contained in:
25
ScientificCalculator/PostfixEval.h
Normal file
25
ScientificCalculator/PostfixEval.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef POSTFIXEVAL_H
|
||||
#define POSYFIXEVAL_H
|
||||
|
||||
#include "Token.h"
|
||||
#include <vector>
|
||||
#include <stack>
|
||||
#include <cmath>
|
||||
#include <stdexcept>
|
||||
#include<unordered_map>
|
||||
|
||||
using namespace std;
|
||||
class PostfixEval {
|
||||
public:
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD><D7BA><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
||||
double run(const std::vector<Token>& postfix, const unordered_map<string, double>& vars = {});
|
||||
|
||||
private:
|
||||
//Ӧ<><D3A6><EFBFBD>ڶ<EFBFBD>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+<2B><>-<2D><>*<2A><>/<2F><>^
|
||||
double apply_BO(const string& op, double a, double b);
|
||||
|
||||
//Ӧ<><D3A6><EFBFBD><EFBFBD>ҽԺ<D2BD><D4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ<EFBFBD><C8BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>sin, cos, log
|
||||
double apply_UF(const string& func, double x);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user