in reply to Re^2: Bit order in bytes
in thread Bit order in bytes
Actually, it's the same results - these templates apparently know whether they're on a big-endian or little-endian machine, and adjust themselves accordingly to standardise the output.
Hm. That is a surprise.
Now I am really confused by the apparent nybble swapping:
print unpack 'b*', "\x12\x34";; 0100 1000 0010 1100 2 1 4 3 print unpack 'B*', "\x12\x34";; 0001 0010 0011 0100 1 2 3 4 print unpack 'b*', pack 'v', 0x1234;; 0010 1100 0100 1000 4 3 2 1 print unpack 'b*', pack 'n', 0x1234;; 0100 1000 0010 1100 2 1 4 3
I can't make sense of that at all.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Bit order in bytes
by syphilis (Archbishop) on Dec 10, 2013 at 13:38 UTC | |
by BrowserUk (Patriarch) on Dec 10, 2013 at 14:15 UTC | |
|
Re^4: Bit order in bytes
by hdb (Monsignor) on Dec 10, 2013 at 13:03 UTC | |
by BrowserUk (Patriarch) on Dec 10, 2013 at 13:10 UTC |