-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnumber.hpp
More file actions
60 lines (50 loc) · 1.58 KB
/
number.hpp
File metadata and controls
60 lines (50 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef NUMBER_H_INCLUDES
#define NUMBER_H_INCLUDES
#include <iostream>
#include <vector>
#include <string>
#include <gmpxx.h>
#define EQUAL 0
namespace number{
bool testdigite(const char * num);
class base
{
private:
mpf_class value;
std::string name;
bool isConst;
public:
base(std::string ,mpf_class );
base(const char * ,mpf_class );
base(std::string );
mpf_class get();
void set(mpf_class);
bool cmp(const char *);
bool cmp(std::string);
bool is_null(void);
void read_only(void);
bool is_const(void);
std::string get_name(void);
std::string c_str();
friend bool operator==(base n1, base n2);
friend base operator+(base n1, base n2);
friend base operator*(base n1, base n2);
friend base operator-(base n1, base n2);
friend base operator/(base n1, base n2);
base& operator= (const base & l1);
};
class NumbersGestion
{
private:
std::vector <base> num;
public:
NumbersGestion(/* args */);
int new_number(std::string, std::string);
int new_number(const char *, const char *);
base get(const char *);
base set(const char *, mpf_class);
base set(const char *, const char *);
int del(const char *);
};
}
#endif