3{-| Library for [bitwise operations](http://en.wikipedia.org/wiki/Bitwise_operation).
7@docs and, or, xor, complement
11@docs shiftLeft, shiftRight, shiftRightLogical
18and : Int -> Int -> Int
19and = Native.Bitwise.and
28xor : Int -> Int -> Int
29xor = Native.Bitwise.xor
31{-| Flip each bit individually, often called bitwise NOT
33complement : Int -> Int
34complement = Native.Bitwise.complement
36{-| Shift bits to the left by a given offset, filling new bits with zeros.
37This can be used to multiply numbers by powers of two.
42shiftLeft : Int -> Int -> Int
43shiftLeft = Native.Bitwise.shiftLeft
45{-| Shift bits to the right by a given offset, filling new bits with
46whatever is the topmost bit. This can be used to divide numbers by powers of two.
48 32 `shiftRight` 1 == 16
49 32 `shiftRight` 2 == 8
50 -32 `shiftRight` 1 == -16
52This is called an [arithmatic right
53shift](http://en.wikipedia.org/wiki/Bitwise_operation#Arithmetic_shift),
54often written (>>), and sometimes called a sign-propagating
55right shift because it fills empty spots with copies of the highest bit.
57shiftRight : Int -> Int -> Int
58shiftRight = Native.Bitwise.shiftRightArithmatic
60{-| Shift bits to the right by a given offset, filling new bits with
63 32 `shiftRightLogical` 1 == 16
64 32 `shiftRightLogical` 2 == 8
65 -32 `shiftRightLogical` 1 == 2147483632
67This is called an [logical right
68shift](http://en.wikipedia.org/wiki/Bitwise_operation#Logical_shift), often written (>>>),
69and sometimes called a zero-fill right shift because it fills empty spots
72shiftRightLogical : Int -> Int -> Int
73shiftRightLogical = Native.Bitwise.shiftRightLogical
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list