<div dir="ltr"><< 0:2, D >> should concat the two. Erlang knows what D is.<div><<0:2/bits, D:6/bits>> should construct a single 8-bit value.</div><div><<D/integer>> should (IMO) be valid because the value (33) is within the range of /integer</div>
<div><br></div><div>How would you convert it back out to 33?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 11, 2014 at 10:32 PM, Dmitry Kolesnikov <span dir="ltr"><<a href="mailto:dmkolesnikov@gmail.com" target="_blank">dmkolesnikov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
Please see comments inline.<br>
<br>
Best Regards,<br>
Dmitry >-|-|-(*><br>
<div class=""><br>
<br>
> On 12.2.2014, at 8.27, Mike Oxford <<a href="mailto:moxford@gmail.com">moxford@gmail.com</a>> wrote:<br>
><br>
> D = <<33:6>><br>
> <<33:6>><br>
</div>D is length 6 bit<br>
<div class="">><br>
> I want to convert that 6 bit value (33) into a numeric value.<br>
><br>
> Why does <<0:2, D>> not work?<br>
</div>Type and size is not specified<br>
<div class="">> Why does <<0:2/bits, D:6/bits>> not work?<br>
</div>Expected size is 8 bits but your bit string is 6<br>
<div class="">> Why does <<D/integer>> not work?<br>
</div>Integer is 32bit<br>
<br>
><br>
> Thanks in advance!<br>
><br>
><br>
><br>
> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>