forked from QuasarApp/QtBigInt
added init constructor
This commit is contained in:
parent
814d7a0247
commit
157fe48a55
@ -34,6 +34,10 @@ BigInt::BigInt(long val):
|
||||
mpz_set_si(data, val);
|
||||
}
|
||||
|
||||
BigInt::BigInt(char item, unsigned int size, int base = 2):
|
||||
BigInt(std::string(size, item),base) {
|
||||
}
|
||||
|
||||
std::string BigInt::getString(int base) const {
|
||||
char *str = mpz_get_str(nullptr, base, data);
|
||||
return str;
|
||||
|
@ -26,6 +26,7 @@ public:
|
||||
BigInt(const std::string &imput, int base = 10);
|
||||
// BigInt(const char * str, int base = 10);
|
||||
BigInt(long val);
|
||||
BigInt(char item, unsigned int size, int base);
|
||||
|
||||
std::string getString(int base = 10) const;
|
||||
~BigInt();
|
||||
|
Loading…
x
Reference in New Issue
Block a user