Binary to integer

Matthias Lang <>
Sat Dec 7 10:10:39 CET 2002

Eduardo Figoli writes:

 > Does someone know how to convert a binary 4 bytes expression to integer ?

7> <<I:32>> = <<1,2,3,4>>.
8> I.

The "bit syntax" I used above has many options for word widths and
endianness. It's described in "Languages Extensions since 4.4":

I also recommend the entire "Language Extensions" part of the manual:


More information about the erlang-questions mailing list