[erlang-questions] Bitstring question

Steve Strong <>
Wed Feb 12 08:16:33 CET 2014


I’d use:  

Eshell V5.10.3  (abort with ^G)
1> D = <<33:6>>.
<<33:6>>
2> <<E:6/integer>> = D.
<<33:6>>
3> E.
33
4>


--  
Steve Strong
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Wednesday, 12 February 2014 at 07:27, Mike Oxford wrote:

> D = <<33:6>>
> <<33:6>>
>  
> I want to convert that 6 bit value (33) into a numeric value.
>  
> Why does <<0:2, D>> not work?  
> Why does <<0:2/bits, D:6/bits>> not work?
> Why does <<D/integer>> not work?   
>  
> Thanks in advance!
>  
>  
>  
> _______________________________________________
> erlang-questions mailing list
>  (mailto:)
> http://erlang.org/mailman/listinfo/erlang-questions
>  
>  


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140212/e986be2d/attachment.html>


More information about the erlang-questions mailing list