[REBOL] Re: bit shifts
From: ryanc:iesco-dms at: 11-Sep-2001 13:43
Something like this should suffice...
>> shift-right: func [series values] [ copy/part head insert copy series
values length? series]
>> byte: "11000011"
== "11000011"
>> shift-right byte "0000"
== "00001100"
>>
And to be symmetrical...
>> shift-left: func [series values] [ skip append copy series values length?
values]
>> shift-left byte "0000"
== "00110000"
>>
--Ryan
Hallvard Ystad wrote:
> Hi folks
>
> How do I use rebol for bit shifts? I feel like shifting the binary string
> "11101000" four places to the right, so it becomes "00001110". How do I do
> that??
>
> ~H
>
> Praetera censeo Carthaginem esse delendam
>
> --
> To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Ryan Cole
Programmer Analyst
www.iesco-dms.com
707-468-5400