Skip to content

Commit

Permalink
Clarify use of unit ranges in multiple-bit functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Borketh authored and oschulz committed Aug 22, 2021
1 parent 253cd0b commit a7641c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ readability and reduces the potential for errors.
BitOperations.jl conventions:

* Bit indices start at zero: `bmask(Int, 0) == 0x01`, `bmask(Int, 1) == 0x02`.

* Bit ranges also start at zero, counting up from the least significant bit: `bset(0x00, 0:7, 1) == 0xff`.
* Bit ranges must be of type `UnitRange` (start:stop) and not `StepRange` (start:step:stop). As a result, reverse indices are not supported.

## Provided functions

Expand Down

0 comments on commit a7641c1

Please sign in to comment.