I read the code `size_t CodedOutputStream::VarintSize32(uint32 value)` and
found that after getting the most significant bits of a value, the code
use "(log2value * 9 + 73) / 64" instead of "log2value / 7 + 1" to calculate
the size need for this varint.

I'm curious how this "(log2value * 9 + 73) / 64" come? What's the
mathematical principle here? The comment said: "Use an explicit
multiplication to implement the divide of a number in the 1..63 range." but
I just can't understand.

-- 
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/CAMUQRevU9qOFO6qig_VVkSmk_iLHXOC008ua8jfGHNZNN8KsMw%40mail.gmail.com.

Reply via email to