MCPcopy Create free account
hub / github.com/catboost/catboost / ZigZagEncode64

Function ZigZagEncode64

library/cpp/yson/zigzag.h:20–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 }
19
20 inline ui64 ZigZagEncode64(i64 n) {
21 // Note: the right-shift must be arithmetic
22 return (ui64(n) << 1) ^ (n >> 63);
23 }
24
25 inline i64 ZigZagDecode64(ui64 n) {
26 return (n >> 1) ^ -static_cast<i64>(n & 1);

Callers 1

WriteVarInt64Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected