- From: Roberto Peon <grmocg@gmail.com>
- Date: Fri, 18 Oct 2013 09:09:54 -0700
- To: Frédéric Kayser <f.kayser@free.fr>
- Cc: HTTP Working Group <ietf-http-wg@w3.org>
- Message-ID: <CAP+FsNcAXY-zOnn8ENp95nYHU8Yr24oqSmq=gO6tKEqj522S=Q@mail.gmail.com>

Yes, the binary operations are equivalent to the arithmetic operations currently specified. I originally had the binary operators in there, but guessed that those familiar with binary operators would do the mapping as you have done, but that for those for whom binary operators was foreign, if would still be understandable. A fair bit of efficiency is gained by allowing the n-bit prefix to encode values since most values for within that first byte. The rest of the int is in a well known and well supported format. -=R On Oct 18, 2013 1:03 AM, "FrÃ©dÃ©ric Kayser" <f.kayser@free.fr> wrote: > Hello, > I have a pretty dumb question regarding integer representation isn't it > easier to grasp expressed as binary masking and right shifts? > This should be the same > I % 128 becomes I & 127 > I / 128 becomes I >> 7 > > And wouldn't it be way easier and faster to record/reconstruct such > integers by moving all the flags (most significant bits) of each byte in > front of the code? > > I < 128 > 0xxxxxxx > I < 16.384 > 10xxxxxx xxxxxxxx (compared to 1yyyyyyy 0yyyyyyy groups of 7 least > significant bits first) > I < 2.097.152 > 110xxxxx xxxxxxxx xxxxxxxx (compared to 1yyyyyyy 1yyyyyyy 0yyyyyyy groups > of 7 least significant bits first) > I < 268.435.456 > 1110xxxx xxxxxxxx xxxxxxxx xxxxxxxx (compared > to 1yyyyyyy 1yyyyyyy 1yyyyyyy 0yyyyyyy groups of 7 least significant bits > first) > â€¦ > > Where xxxâ€¦xxx is simply the binary representation of I > > The first part looks like unary coding and the overall form of this > encoding is a 7, 7, âˆž start-step-code or a base 128 Elias Î³â€² code, do you > really want to keep the universal nature of such a code or cap it? > > Regards > -- > FrÃ©dÃ©ric Kayser >

Received on Friday, 18 October 2013 16:10:25 UTC