>>> is a logical right shift. It shifts bits right filling vacant positions 
>>> with 0 (as opposed to >> which fills vacant positions with sign bit).

In JavaScript >>> also performs ToUint32 on the input before doing
shift (as opposed to >> which converts input via ToInt32) so the
result is always a number from unsigned 32-bit integer range.

See: http://es5.github.com/#x11.7.3

x >>> 0 is basically ToUint32(x)

--
Vyacheslav Egorov

On Wed, May 30, 2012 at 6:34 PM, Stephan Beal <[email protected]> wrote:
> On Wed, May 30, 2012 at 6:25 PM, Vyacheslav Egorov <[email protected]>
> wrote:
>>
>> c) stop doing >>> 0 at the end;
>
>
> A side question: what does >>>0 do? i have never seen the >>> operator
> before this thread and never seen a 0-bit shift anywhere.
>
> :-?
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to