>Hi Jorge,
>
>JAM> How can I perform an arithmetic shift (or a floored division) in
>JAM> REBOL?
>
>to integer! value / radix

Note that to-integer (or to integer!) isn't always required to return an integer with 
division...

>> type? 3 / 2
== decimal!
>> type? 4 / 2
== integer!
>> type? 12 / 4
== integer!

Which also allows us to do the likes of this...

>> x: 5 and 254 / 2
== 2
>> type? x
== integer!

I suspect this has speed advantages too, though I've not done any tests.

-- Carl Read

-- 
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.

Reply via email to