20 #include "ns3/core-config.h"
21 #if !defined(INT64X64_DOUBLE_H) && (defined (INT64X64_USE_DOUBLE) || defined(PYTHON_SCAN))
22 #define INT64X64_DOUBLE_H
44 static const uint64_t HP_MASK_LO = 0xffffffffffffffffULL;
57 #define HP_MAX_64 (std::pow (2.0L, 64))
74 static const enum impl_type implementation = ld_impl;
116 explicit inline int64x64_t (int64_t hi, uint64_t lo)
118 const bool negative = hi < 0;
119 const long double fhi = negative ? -hi : hi;
120 const long double flo = lo / HP_MAX_64;
121 _v = negative ? - fhi : fhi;
149 inline double GetDouble (
void)
const
159 std::pair<int64_t, uint64_t> GetHighLow (
void)
const
161 const bool negative = _v < 0;
162 const long double v = negative ? -_v : _v;
165 long double flo = std::modf (v, &fhi);
174 const long double round = 0.5;
175 flo = flo * HP_MAX_64 + round;
178 if (flo >= HP_MAX_64)
192 return std::make_pair (hi, lo);
200 inline int64_t GetHigh (
void)
const
202 return GetHighLow ().first;
209 inline uint64_t GetLow (
void)
const
211 return GetHighLow ().second;
223 inline void MulByInvert (
const int64x64_t & o)
265 return lhs._v == rhs._v;
273 return lhs._v < rhs._v;
281 return lhs._v > rhs._v;
High precision numerical type, implementing Q64.64 fixed precision.
bool operator>(const Time &lhs, const Time &rhs)
Time & operator+=(Time &lhs, const Time &rhs)
TracedValue< T > & operator/=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
int64x64_t operator+(const int64x64_t &lhs, const int64x64_t &rhs)
Addition operator.
TracedValue< T > operator!(const TracedValue< T > &lhs)
Unary arithmetic operator for TracedValue.
int64x64_t operator-(const int64x64_t &lhs, const int64x64_t &rhs)
Subtraction operator.
Time & operator-=(Time &lhs, const Time &rhs)
bool operator==(const BleAccessAddress &a, const BleAccessAddress &b)
TracedValue< T > & operator*=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
bool operator<(const BleAccessAddress &a, const BleAccessAddress &b)