File: uint128_t.cpp

package info (click to toggle)
libsdsl 2.1.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,992 kB
  • sloc: cpp: 42,286; makefile: 1,171; ansic: 318; sh: 201; python: 27
file content (19 lines) | stat: -rw-r--r-- 433 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "sdsl/uint128_t.hpp"

//! Namespace for the succinct data structure library
namespace sdsl
{

std::ostream& operator<<(std::ostream& os, const uint128_t& x)
{
    uint64_t X[2] = {(uint64_t)(x >> 64), (uint64_t)x};
    for (int j=0; j < 2; ++j) {
        for (int i=0; i < 16; ++i) {
            os << std::hex << ((X[j]>>60)&0xFULL) << std::dec;
            X[j] <<= 4;
        }
    }
    return os;
}

} // end namespace