[REBOL] Re: subtracting binaries
From: maarten:vrijheid at: 3-Apr-2004 8:14
Hi Gregg,
> I know I have other things to be doing :), but this kept coming up in my
> mind...wondering if doing binary math on bitsets would work.
I considered series! (or actually, block!). Bitset! is interesting as
well. What did I do so far:
result: copy []
parse enbase/base checksum/secure mold now/precise 2 [ any [ "1" (append
result 1) | "0" (append result 0)]]
This makes for easy computation with a for loop counting backwards (or
doing it big-endian and going forward after reversing). As my problem
only needs to initialize once the parse is OK.
Now, back to a binary is also easy:
debase/base rejoin result 16
Funny: > < and maximum-of and minimum-of work on binaries! So comparison
is easy (it's also an important part of what I need).
> The following is very much a proof-of-concept, but it might be an idea
> worth pursuing.
>
Thanks!
Now.... why do I want to do all this?
--Maarten