12 return {
a >= 0 ? 0 : -1, (uint32_t)
a};
16 return {
a >> 32, (uint32_t)(
a & 0xFFFFFFFF)};
20 return std::tie(
a.hi,
a.lo) == std::tie(
b.hi,
b.lo);
24 return std::tie(
a.hi,
a.lo) < std::tie(
b.hi,
b.lo);
28 uint32_t lo =
a.lo +
b.lo;
29 int64_t carry = lo <
a.lo;
30 int64_t hi =
a.hi +
b.hi + carry;
43 uint64_t loA =
a & 0xFFFFFFFF;
44 uint64_t loB = (uint32_t)
b;
45 uint64_t newLo = loA * loB;
48 int64_t newHi = (
a >> 32) * (int64_t)
b;
52 int64_t lowOverflow = newLo >> 32;
62 return {newHi, (uint32_t)newLo};
bool operator<(const Int96 &a, const Int96 &b)
Int96 operator+(const Int96 &a, const Int96 &b)
Int96 multiply(int64_t a, int32_t b)
bool operator==(const Int96 &a, const Int96 &b)
static Int96 Make(int32_t a)