Complete splitting code into source files.

This commit is contained in:
2018-08-17 01:34:58 -07:00
parent dfad4a2cfc
commit 48355b0736
15 changed files with 263 additions and 216 deletions

View File

@@ -5,24 +5,15 @@
struct string {
std::string value;
string(std::string&& new_value) : value(std::move(new_value)) {}
string(const std::string& new_value) : value(new_value) {}
string(std::string&& new_value);
string(const std::string& new_value);
};
struct number {
mpfr_t value;
number(const char* new_value) {
mpfr_init2(value, PRECISION);
mpfr_set_str(value, new_value, 10, MPFR_RNDN);
}
number(mpfr_t&& new_value) {
std::swap(value, new_value);
}
int to_int() {
return mpfr_get_si(value, MPFR_RNDN);
}
~number() {
mpfr_clear(value);
}
number(const char* new_value);
number(mpfr_t&& new_value);
int to_int();
~number();
};