3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-03-07 22:04:53 +00:00
This commit is contained in:
Nuno Lopes 2026-02-15 16:15:06 +00:00
parent 8562788ad8
commit 10f986ee1a
2 changed files with 7 additions and 3 deletions

View file

@ -96,7 +96,7 @@ private:
// This gives us:
// - On 32-bit platforms: 31 bits, range [-2^30, 2^30-1]
// - On 64-bit platforms: 63 bits, range [-2^62, 2^62-1]
static constexpr unaigned SMALL_BITS = sizeof(uintptr_t) * 8 - 1;
static constexpr unsigned SMALL_BITS = sizeof(uintptr_t) * 8 - 1;
// Maximum and minimum values that can be stored as small integers
static constexpr int64_t SMALL_INT_MAX = (static_cast<int64_t>(1) << (SMALL_BITS - 1)) - 1;
@ -174,6 +174,10 @@ public:
return *this;
}
void swap(mpz & other) noexcept {
std::swap(m_value, other.m_value);
}
void set64(int64_t v) {
SASSERT(is_small());
SASSERT(fits_in_small(v));

View file

@ -103,8 +103,8 @@ static inline unsigned next_power_of_two(unsigned v) {
/**
\brief Return the position of the most significant bit.
*/
static inline unsigned log2(unsigned v) { return std::bit_width(x) - 1; }
static inline unsigned log2(uint64_t v) { return std::bit_width(x) - 1; }
static inline unsigned log2(unsigned v) { return std::bit_width(v) - 1; }
static inline unsigned log2(uint64_t v) { return std::bit_width(v) - 1; }
static_assert(sizeof(unsigned) == 4, "unsigned are 32 bits");