mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
added ++fil and ++swap
This commit is contained in:
parent
a05b79a0d3
commit
465f22a918
@ -821,6 +821,15 @@
|
||||
|= [a=bloq b=@ c=@]
|
||||
(mod c (bex (mul (bex a) b)))
|
||||
::
|
||||
++ fil :: fill bloqstream
|
||||
|= [a=bloq b=@ c=@]
|
||||
=+ n=0
|
||||
=+ d=c
|
||||
|- ^- @
|
||||
?: =(n b)
|
||||
(rsh a 1 d)
|
||||
$(d (add c (lsh a 1 d)), n +(n))
|
||||
:::
|
||||
++ lsh :: left-shift
|
||||
~/ %lsh
|
||||
|= [a=bloq b=@ c=@]
|
||||
@ -866,6 +875,8 @@
|
||||
~/ %rsh
|
||||
|= [a=bloq b=@ c=@]
|
||||
(div c (bex (mul (bex a) b)))
|
||||
++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order
|
||||
::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: section 2cB, bit logic ::
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user