1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-24 10:27:45 +00:00

expansion analyzer now can use libgmp for better analysis

This commit is contained in:
Zeno Rogue
2020-07-05 00:53:02 +02:00
parent 2d7571034b
commit 6f2e7e90d5
4 changed files with 116 additions and 30 deletions

View File

@@ -507,6 +507,15 @@ struct bignum {
return digits[0] + digits[1] * (long long) BASE;
}
#if CAP_GMP
mpq_class as_mpq() const {
string s = get_str(999999);
string t;
for(char c: s) if(c != ' ') t += c;
return mpq_class(t);
}
#endif
friend inline bignum operator +(bignum a, const bignum& b) { a.addmul(b, 1); return a; }
friend inline bignum operator -(bignum a, const bignum& b) { a.addmul(b, -1); return a; }
};