[erlang-questions] How to create a bit array / bit vector

Robert Carbone erlang@REDACTED
Wed Feb 27 06:23:58 CET 2019


Hey Maverick -


Perhaps what you are looking for is this?

fill(Len) -> <<(bnot 0):Len>>.


Cheers,

Robert Carbone

scriptculture.com


On 2/26/19 5:09 PM, maverik a wrote:
> Hi All,
>
> I'm trying to create a bit array in Erlang with simple new() , set() 
> and get() operations.
>
> My new() looks like:
> new(Max) ->
> N=1bslMax-1,
> <<N>>.
>
> but problem I'm stuck with is, my max can be at most 8 .
>
> How can I create a *bitstring *of Max length ?
>
> Regards
> Maverick
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190226/c3588500/attachment.htm>


More information about the erlang-questions mailing list