FreeBSD/contrib/subversion/subversion/libsvn_subr/packed_data.c
/* Return remapped VALUE.
 *
 * Due to sign conversion and diff underflow, values close to UINT64_MAX
 * are almost as frequent as those close to 0.  Remap them such that the
 * MSB is stored in the LSB and the remainder stores the absolute distance
 * to 0.
 *
 * This minimizes the absolute value to store in many scenarios.
 * Hence, the variable-length representation on disk is shorter, too.
 */
Return remapped VALUE.
Due to sign conversion and diff underflow, values close to UINT64_MAX
are almost as frequent as those close to 0.  Remap them such that the
MSB is stored in the LSB and the remainder stores the absolute distance
to 0.

This minimizes the absolute value to store in many scenarios.
Hence, the variable-length representation on disk is shorter, too.
Return remapped VALUE . Due to sign conversion and diff underflow values close to UINT64_MAX are almost as frequent as those close to 0 . Remap them such that the MSB is stored in the LSB and the remainder stores the absolute distance to 0 . This minimizes the absolute value to store in many scenarios . Hence the variable - length representation on disk is shorter too .
static apr_uint64_t
remap_uint(apr_uint64_t value)
{
  return value & APR_UINT64_C(0x8000000000000000)
       ? APR_UINT64_MAX - (2 * value)
       : 2 * value;
}
static apr_uint64_t remap_uint ( apr_uint64_t value ) { return value & APR_UINT64_C ( 0x8000000000000000 ) ? APR_UINT64_MAX - ( 2 * value ) : 2 * value ; }
Return remapped VALUE.
Return remapped VALUE .