Skip to content

Commit c1b54c6

Browse files
authored
Add callout to full bitstring reference in the getting started guide (#13360)
1 parent 28248f4 commit c1b54c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/elixir/pages/getting-started/binaries-strings-and-charlists.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ We are getting a little bit ahead of ourselves. Let's talk about bitstrings to l
9494

9595
## Bitstrings
9696

97-
Although we have covered code points and UTF-8 encoding, we still need to go a bit deeper into how exactly we store the encoded bytes, and this is where we introduce the **bitstring**. A bitstring is a fundamental data type in Elixir, denoted with the `<<>>/1` syntax. **A bitstring is a contiguous sequence of bits in memory.**
97+
Although we have covered code points and UTF-8 encoding, we still need to go a bit deeper into how exactly we store the encoded bytes, and this is where we introduce the **bitstring**. A bitstring is a fundamental data type in Elixir, denoted with the [`<<>>`](`<<>>/1`) syntax. **A bitstring is a contiguous sequence of bits in memory.**
9898

9999
By default, 8 bits (i.e. 1 byte) is used to store each number in a bitstring, but you can manually specify the number of bits via a `::n` modifier to denote the size in `n` bits, or you can use the more verbose declaration `::size(n)`:
100100

@@ -121,6 +121,8 @@ true
121121

122122
Here, 257 in base 2 would be represented as `100000001`, but since we have reserved only 8 bits for its representation (by default), the left-most bit is ignored and the value becomes truncated to `00000001`, or simply `1` in decimal.
123123

124+
A complete reference for the bitstring constructor can be found in [`<<>>`](`<<>>/1`)'s documentation.
125+
124126
## Binaries
125127

126128
**A binary is a bitstring where the number of bits is divisible by 8.** That means that every binary is a bitstring, but not every bitstring is a binary. We can use the `is_bitstring/1` and `is_binary/1` functions to demonstrate this.

0 commit comments

Comments
 (0)