September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -0,0 +1,8 @@
|
|||
fcn to_seq(x){ //--> list of ints
|
||||
z:=(x.log2()/7);
|
||||
(0).pump(z+1,List,'wrap(j){
|
||||
x.shiftRight((z-j)*7).bitAnd(0x7f).bitOr((j!=z) and 0x80 or 0)
|
||||
});
|
||||
}
|
||||
|
||||
fcn from_seq(in){ in.reduce(fcn(p,n){ p.shiftLeft(7).bitOr(n.bitAnd(0x7f)) },0) }
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
ns:=T(0x7f, 0x4000, 0, 0x3ffffe, 0x1fffff, 0x200000, 0x3311a1234df31413);
|
||||
ms:=ns.apply(to_seq);
|
||||
ns.zipWith(fcn{"%8,x --> %s --> %,x".fmt(vm.arglist.xplode()).println()},
|
||||
ms.apply("apply","%,x".fmt),
|
||||
ms.apply(from_seq));
|
||||
Loading…
Add table
Add a link
Reference in a new issue