Frankly, negative numbers shouldn't be encoded as varints at all.  It's only
for historical reasons that we do it.
If the last byte were 0x7f, that only gets you to 70 bits, so I'm not sure
how you could go from there to arbitrarily large numbers.

On Mon, Aug 10, 2009 at 10:05 AM, rog <> wrote:

> when serialising a negative number as a varint,
> the last byte is encoded as 0x1, not 0x7f.
> might it not be better if it was encoded as the
> latter, to allow potential future extensions,
> such as 128-bit, or arbitrarily large, integers,
> without compromising old code?
> >

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to