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

Function ZigZagEncode64

library/cpp/yt/coding/zig_zag-inl.h:25–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25inline ui64 ZigZagEncode64(i64 n)
26{
27 // Note: the right-shift must be arithmetic.
28 // Note: left shift must be unsigned because of overflow.
29 return (static_cast<ui64>(n) << 1) ^ static_cast<ui64>(n >> 63);
30}
31
32inline i64 ZigZagDecode64(ui64 n)
33{

Callers 2

WriteVarInt64ImplFunction · 0.70
TESTFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected