[erlang-questions] number->bytes and bytes->number

Chandru chandrashekhar.mullaparthi@REDACTED
Thu May 17 12:03:27 CEST 2007


On 16/05/07, Gary Jefferson <garyjefferson123@REDACTED> wrote:
> Thanks, Matthias and Christian.  Now, how do I go back
> (from list/binary to number)?  I'm such a noob.  Where
> is a good resource on reading about datatypes in
> erlang?
>
> Thanks,
> Gary
>

1> Int = 2 bsl 160.
2923003274661805836407369665432566039311865085952
2> Bin = <<Int:168>>.
<<2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>
3>
3>
3>
3> <<SameInt:168>> = Bin.
<<2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>
4> SameInt.
2923003274661805836407369665432566039311865085952



More information about the erlang-questions mailing list