Hi folks,

Has anyone noticed that the example message which begins the document is 
erroneous.   At one point (under the Message Structure heading) the authors 
claim that:

96 01 = 1001 0110  0000 0001

which it cannot,  since 1001 0110 in radix 10 is 150.  The l.h.s. of the 
equation should read 150 01 (as it also should in the message format at the 
very top of the document, which would be 08 150 01).

They go on to decode the binary part and get the correct answer.   However 
that only worked because the binary expression really corresponds to a 
l.h.s of the equation expresssed as:   150 01.     Of course that is just a 
bit inconvenient because it looks very much like the value they seek to 
decode (150)...and that coincidence that could confuse the reader;  but it 
happens only because the first byte must have the msb set to 1 (Varint 
encoding) and only the 7 lsb contain the value.   That value is 22, which 
when added to the 1 in the second byte, left-shifted seven places to equal 
128,  yields 150.

Anyone know how to get the attention of the documentation group?

Thanks and Regards.

Gregory B.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/572700a9-904a-4f8c-8bc4-894c591209dbn%40googlegroups.com.

Reply via email to