Binary construction

chandru chandrashekhar.mullaparthi@REDACTED
Fri Feb 24 14:36:41 CET 2006


Hi,

23> <<1:16>>.
<<0,1>>
24> <<21:16>>.
<<0,21>>
25> <<321:16>>.
<<1,65>>
26> <<4321:16>>.
<<16,225>>
27> <<54321:16>>.
<<212,49>>
28> <<654321:16>>.
<<251,241>>
29> <<7654321:16>>.
<<203,177>>
30> <<87654321:16>>.
<<127,177>>

Why are the resulting binaries all different? I thought that if I gave
a value of more than 65535 and asked for it to be packed into 16 bits,
I would always get <<255,255>>. Why is it not?

cheers
Chandru



More information about the erlang-questions mailing list