17template<
typename T,
int S>
22 mpz_set_str(
x,
str.c_str(), base);
23 for (
int i = 0; i < S; i++) {
24 static_assert(
sizeof(
T) <=
sizeof(
decltype(mpz_get_ui(
x))));
25 this->
v[i] =
T(mpz_get_ui(
x));
26 mpz_div_2exp(
x,
x, 8 *
sizeof(
T));
31template<
typename T,
int S>
36 this->
v = unsigned_value.v;
41 this->
v = unsigned_value.v;
49 for (
int i = S - 1; i >= 0; i--) {
50 static_assert(
sizeof(
T) <=
sizeof(
decltype(mpz_get_ui(
x))));
51 mpz_mul_2exp(
x,
x, 8 *
sizeof(
T));
52 mpz_add_ui(
x,
x, this->
v[i]);
56 const int str_size = mpz_sizeinbase(
x, base) + 2;
57 Array<char, 1024>
str(str_size);
58 mpz_get_str(
str.data(), base,
x);
60 return std::string(
str.data());
67 str.insert(
str.begin(),
'-');
ATTR_WARN_UNUSED_RESULT const BMVert * v
bool is_negative(const IntF< T, Size > &a)