on 492ae2f help sign in
57 lines 850 B history raw
1### `++rsh`
3Right-shift
5Right-shifts `c` by `b` blocks of size `a`, producing an atom.
7Accepts
8-------
10`a` is a block size (see `++bloq`).
12`b` is an atom.
14`c` is an atom.
16Produces
17--------
19An atom.
21Source
22------
24 ++ rsh :: right-shift
25 ~/ %rsh
26 |= {a/bloq b/@u c/@}
27 (div c (bex (mul (bex a) b)))
29Examples
30--------
32 ~zod/try=> `@ub`145
33 0b1001.0001
34 ~zod/try=> `@ub`(rsh 1 1 145)
35 0b10.0100
36 ~zod/try=> (rsh 1 1 145)
37 36
38 ~zod/try=> `@ub`(rsh 2 1 145)
39 0b1001
40 ~zod/try=> (rsh 2 1 145)
41 9
42 ~zod/try=> `@ub`10
43 0b1010
44 ~zod/try=> `@ub`(rsh 0 1 10)
45 0b101
46 ~zod/try=> (rsh 0 1 10)
47 5
48 ~zod/try=> `@ux`'abc'
49 0x63.6261
50 ~zod/try=> `@t`(rsh 3 1 'abc')
51 'bc'
52 ~zod/try=> `@ux`(rsh 3 1 'abc')
53 0x6362
57***