Skip to content

Commit

Permalink
Expand and fix documentation of BitArray (#30340)
Browse files Browse the repository at this point in the history
Fixes #30337... and while I was there I added a bit more information about what BitArrays do and when you might run into them.
  • Loading branch information
mbauman authored and fredrikekre committed Dec 11, 2018
1 parent 58f9bf7 commit 0d62000
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions base/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
# notes: bits are stored in contiguous chunks
# unused bits must always be set to 0
"""
BitArray{N} <: DenseArray{Bool, N}
BitArray{N} <: AbstractArray{Bool, N}
Space-efficient `N`-dimensional boolean array, which stores one bit per boolean value.
Space-efficient `N`-dimensional boolean array, using just one bit for each boolean value.
`BitArray`s pack up to 64 values into every 8 bytes, resulting in an 8x space efficiency
over `Array{Bool, N}` and allowing some operations to work on 64 values at once.
By default, Julia returns `BitArrays` from [broadcasting](@ref Broadcasting) operations
that generate boolean elements (including dotted-comparisons like `.==`) as well as from
the functions [`trues`](@ref) and [`falses`](@ref).
"""
mutable struct BitArray{N} <: AbstractArray{Bool, N}
chunks::Vector{UInt64}
Expand Down

0 comments on commit 0d62000

Please sign in to comment.