2 Star 0 Fork 0

Kenneth-Lee-2012 / card24

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ana_val.hpp 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
Kenneth Lee 提交于 2022-10-19 11:51 . refine the build structure
// Copyrights by Kenneth Lee, 2022. All Rights Reserved
#ifndef __ANA_VAL_HPP__
#define __ANA_VAL_HPP__
#include <iostream>
#include <assert.h>
#include "valif.hpp"
class AnaVal: public ValIf {
private:
int numer, demom; // numerator and demominator
void simplify(void);
public:
AnaVal(int i);
AnaVal(const char *s);
AnaVal(int n, int d);
AnaVal();
AnaVal &operator=(const char *s);
friend ostream & operator<<(ostream & os, const AnaVal & fv);
friend bool operator==(const AnaVal &l, const AnaVal &r);
friend bool operator==(const AnaVal &l, const int &r);
friend AnaVal operator+(const AnaVal &l, const AnaVal &r);
friend AnaVal operator-(const AnaVal &l, const AnaVal &r);
friend AnaVal operator*(const AnaVal &l, const AnaVal &r);
friend AnaVal operator/(const AnaVal &l, const AnaVal &r);
};
extern ostream & operator<<(ostream & os, const AnaVal & fv);
extern bool operator==(const AnaVal &l, const AnaVal &r);
extern bool operator==(const AnaVal &l, const int &r);
extern AnaVal operator+(const AnaVal &l, const AnaVal &r);
extern AnaVal operator-(const AnaVal &l, const AnaVal &r);
extern AnaVal operator*(const AnaVal &l, const AnaVal &r);
extern AnaVal operator/(const AnaVal &l, const AnaVal &r);
#endif
C++
1
https://gitee.com/Kenneth-Lee-2012/card24.git
git@gitee.com:Kenneth-Lee-2012/card24.git
Kenneth-Lee-2012
card24
card24
master

搜索帮助