39 std::ostream &
operator << (std::ostream &os,
const int64x64_t &value)
41 int64_t hi = value.GetHigh ();
44 std::ios_base::fmtflags ff = os.flags ();
61 uint64_t low = value.GetLow ();
67 uint8_t digit = low / pow;
69 os << (uint16_t) digit;
71 }
while (msd > 0 && low > 0);
77 const char *buf = str.c_str ();
82 retval += *buf - 0x30;
88 std::istream &
operator >> (std::istream &is, int64x64_t &value)
95 std::string::size_type cur;
96 cur = str.find_first_not_of (
" ");
97 std::string::size_type next;
99 next = str.find (
"-", cur);
100 if (next != std::string::npos)
107 next = str.find (
"+", cur);
108 if (next != std::string::npos)
121 next = str.find (
".", cur);
122 if (next != std::string::npos)
125 lo =
ReadDigits (str.substr (next+1, str.size ()-(next+1)));
129 hi =
ReadDigits (str.substr (cur, str.size ()-cur));
132 hi = negative ? -hi : hi;
133 value = int64x64_t (hi, lo);
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
#define NS_ASSERT(condition)
static uint64_t ReadDigits(std::string str)
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
static uint8_t MostSignificantDigit(uint64_t value)
NS_LOG_COMPONENT_DEFINE("int64x64")
static uint64_t PowerOfTen(uint8_t n)