blob: be39e3868ae8939575b5523c609c17a9f6887ddf (
plain)
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
|
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_GMP
#include <gmpxx.h>
#include "GMPString.h"
GMPString::GMPString(const GMPString & s) : str(s.str) {
}
GMPString::GMPString(const mpz_class & z) {
gmp_asprintf(&str, "%Zd", z.get_mpz_t());
}
GMPString::GMPString(const mpq_class & q) {
gmp_asprintf(&str, "%Qd", q.get_mpq_t());
}
GMPString::GMPString(const mpf_class & f) {
gmp_asprintf(&str, "%Ff", f.get_mpf_t());
}
GMPString::operator String() const {
return String(str);
}
GMPString::~GMPString() {
}
#endif
|