[Haskell-cafe] Endianess

Jed Brown jed at 59A2.org
Tue May 13 15:11:02 EDT 2008

On Tue 2008-05-13 20:46, Ketil Malde wrote:
> Aaron Denney <wnoise at ofb.net> writes:
> I guess it depends a lot on what you grew up with.  The names
> (little/big endian) are incredibly apt.
> The only argument I can come up with, is that big endian seems to make
> more sense for 'od':
>   % echo foobar > foo 
>   % od -x foo
>   0000000 6f66 626f 7261 000a
>   0000007

This, of course, is because `od -x' regards the input as 16-bit integers.  We
can get saner output if we regard it is 8-bit integers.

  $ od -t x1 foo
  0000000 66 6f 6f 62 61 72 0a

> > Now I'm convinced that little endian is the way to go, as bit number n
> > should have value 2^n, byte number n should have value 256^n, and so forth.

It's not that simple with bits.  They lack consistency just like the usual US
date format and the way Germans read numbers.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080513/dec91f7b/attachment.bin

More information about the Haskell-Cafe mailing list