Best question to ask

Why <<5::2>> == <<1::2>>? Elixir

Bits vary in size not in numbers

Malreddy Ankanna
Published in
3 min readApr 18, 2020

--

This article talks about the bitstrings and binaries representation. Let’s dive.

In Elixir we use <<0>> for binary(8 bits) reprsentation. However, we can tell how many bits of information we need with size(num) i.e <<5::size(3)>> for 3 bits instead of size(8) which is…

--

--

Malreddy Ankanna
blackode

Programmer & Writer, I write about coding, thoughts, ideas, personal musings, technical articles, and tutorials.https://bio.link/blackode