13#if defined(INT64X64_USE_128) && !defined(PYTHON_SCAN)
45 ua = negA ? -
static_cast<uint128_t>(sa) : sa;
46 ub = negB ? -
static_cast<uint128_t>(sb) : sb;
124 _v = negative ? -result : result;
137 const uint64_t DIGITS = 64;
146 while ((shift < DIGITS) && !(den & 0x1))
152 while ((digis < DIGITS) && (rem != ZERO))
165 while ((digis + shift < DIGITS) && (!(den & 0x1) || (rem < den)))
185 shift = DIGITS - digis;
195 bool negResult =
_v < 0;
199 _v = negResult ? -result : result;
NS_ABORT_x macro definitions.
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
High precision numerical type, implementing Q64.64 fixed precision.
int64_t GetHigh() const
Get the integer portion.
static const uint64_t HP_MASK_LO
Mask for fraction part.
static const uint128_t HP128_MASK_HI_BIT
uint128_t high bit (sign bit).
void Mul(const int64x64_t &o)
Implement *=.
static uint128_t Udiv(const uint128_t a, const uint128_t b)
Unsigned division of Q64.64 values.
void MulByInvert(const int64x64_t &o)
Multiply this value by a Q0.128 value, presumably representing an inverse, completing a division oper...
static uint128_t UmulByInvert(const uint128_t a, const uint128_t b)
Unsigned multiplication of Q64.64 and Q0.128 values.
int128_t _v
The Q64.64 value.
void Div(const int64x64_t &o)
Implement /=.
static int64x64_t Invert(const uint64_t v)
Compute the inverse of an integer value.
static uint128_t Umul(const uint128_t a, const uint128_t b)
Unsigned multiplication of Q64.64 values.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
__uint128_t uint128_t
Use uint128_t for int64x64_t implementation.
__int128_t int128_t
Use uint128_t for int64x64_t implementation.
static bool output_sign(const int128_t sa, const int128_t sb, uint128_t &ua, uint128_t &ub)
Compute the sign of the result of multiplying or dividing Q64.64 fixed precision operands.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Declaration of the ns3::int64x64_t type using a native int128_t type.
Every class exported by the ns3 library is enclosed in the ns3 namespace.