BEAM endianess?

Bjorn Gustavsson <>
Thu Aug 19 10:11:58 CEST 2004

Vance Shipley <> writes:

> 	Is a BEAM file big-endian or little-endian?

Numeric literals in Beam files are stored in big-endian order.

In the process of loading Beam files, among a lot of other code
rewriting, numeric literals are converted to the native endian of
the CPU the Erlang machine is runing on. Integer literals that will
not fit in a machine word are converted to a big number format.
On a 32 bit CPU, signed integers up to 28 bits can fit in a word
(the remaining 4 bits are used for the type tag).

Björn Gustavsson, Erlang/OTP, Ericsson AB

More information about the erlang-questions mailing list