Function ADS::signedToNatural

Function Documentation

constexpr std::uint64_t ADS::signedToNatural(std::int64_t x)

x as a natural number: 2 x if x >= 0, -2 x + 1 if x < 0

Pre:

|x| < 2^62