mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Add documentation for bitwise functions
This commit is contained in:
parent
402a89237d
commit
5512dd9675
1 changed files with 11 additions and 0 deletions
|
@ -976,10 +976,21 @@ remChecked = \a, b ->
|
|||
|
||||
isMultipleOf : Int a, Int a -> Bool
|
||||
|
||||
## Does a "bitwise and". Each bit of the output is 1 if the corresponding bit
|
||||
## of x AND of y is 1, otherwise it's 0.
|
||||
bitwiseAnd : Int a, Int a -> Int a
|
||||
|
||||
## Does a "bitwise or". Each bit of the output is 0 if the corresponding bit
|
||||
## of x AND of y is 0, otherwise it's 1.
|
||||
bitwiseXor : Int a, Int a -> Int a
|
||||
|
||||
## Does a "bitwise exclusive or". Each bit of the output is the same as the
|
||||
## corresponding bit in x if that bit in y is 0, and it's the complement of
|
||||
## the bit in x if that bit in y is 1.
|
||||
bitwiseOr : Int a, Int a -> Int a
|
||||
|
||||
## Returns the complement of x - the number you get by switching each 1 for a
|
||||
## 0 and each 0 for a 1. This is the same as -x - 1.
|
||||
bitwiseNot : Int a -> Int a
|
||||
bitwiseNot = \n ->
|
||||
bitwiseXor n (subWrap 0 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue