Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
A pointer to doc that explains what's behind b vs B decoding would be greatly appreciated. In terms of single bytes, the difference between 'b' & 'B' templates is purely a matter of cosmetics; that is, the same information is being presented differently:
Nothing changed in the hardware or the internal representation of 'A', just order in which the bits are presented to the user.
Where the real difference comes in is when dealing with values greater than one byte:
As you can see, not only is the bit-order different, but so is the apparent ordering of the nybbles within the bytes. In part this is due to my using a little-endian hardware. If you are using or have access to a big-endian machine, you'd see different results above, but they would still both be just different ways of viewing the same information. Again nothing changed in the storage of the values within the memory, the apparent reordering is purely down to the way the bits are displayed. So, the difference is just an illusion created by the the way you are viewing the bits, and probably not what you should be concentrating on. Provided you are calculating the correct bit positions for your use of vec in _set_header_field() -- which is a matter of whether you've done your homework correctly -- how you chose to view those bits (ie.with 'b' or 'B') is really down to which makes more sense for you. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In reply to Re: Bit order in bytes
by BrowserUk
|
|