fixup! fixup! Step 1: Convert Number to use 128-bit numbers internally

This commit is contained in:
Ed Hennis
2025-11-12 12:16:18 -05:00
parent 3048f55270
commit a32b5723e5
2 changed files with 22 additions and 0 deletions

View File

@@ -63,6 +63,12 @@ public:
// add a digit
void
push(numberuint128 d) noexcept;
#ifdef _MSC_VER
void
push(numberint128 d) noexcept;
void
push(std::int64_t d) noexcept;
#endif
// recover a digit
unsigned
@@ -103,6 +109,20 @@ Number::Guard::push(numberuint128 d128) noexcept
digits_ |= (d & 0x0000'0000'0000'000FULL) << 60;
}
#ifdef _MSC_VER
void
Number::Guard::push(numberint128 d) noexcept
{
push(static_cast<numberuint128>(d));
}
void
Number::Guard::push(std::int64_t d) noexcept
{
push(static_cast<numberuint128>(d));
}
#endif
inline unsigned
Number::Guard::pop() noexcept
{

View File

@@ -745,6 +745,8 @@ public:
Number maxInt64{std::numeric_limits<std::int64_t>::max()};
BEAST_EXPECT(maxInt64.exponent() <= 0);
// TODO: square maxInt64 and square Number::max()
using namespace boost::multiprecision;
// maxint64 9,223,372,036,854,775,808
int128_t minMantissa{1'000'000'000'000'000'000LL};