24 m = 0xffffffffffffffffull;
31 uint32_t l = narrow<uint32_t>(std::bit_width(
t));
32 uint64_t j = 0xffffffffffffffffull %
t;
33 uint128 k = (
uint128(1) << (64 + l)) / (0xffffffffffffffffull - j);
36 while (((m_low >> 1) < (m_high >> 1)) && (l > 0)) {
41 if ((m_high >> 64) == 0) {
49 s = narrow<uint32_t>(std::bit_width(
t) - 1);
51 uint64_t r = low64((
uint128(1) << (64 + s)) %
t);
52 m = low64(m_low2 + ((r <= (
t >> 1)) ? 0 : 1));
void setDivisor(uint32_t divisor)
Unsigned 128-bit integer type.
This file implemented 3 utility functions: