0

I've seen this symbol used in math in some javascript functions: >>

I can't find reference to what it means?

The context would be something like:

(a*100)*(b*100) >> 8
Cœur
  • 37,241
  • 25
  • 195
  • 267
Futile32
  • 834
  • 2
  • 8
  • 15
  • 2
    It's a [bitwise shift operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators). – James Allardice Nov 20 '13 at 11:12
  • 3
    [Bitwise Right Shift Operator](http://msdn.microsoft.com/en-us/library/ie/5s9e947e%28v=vs.94%29.aspx) – Itay Nov 20 '13 at 11:12
  • possible duplicate of [What does JavaScript >> stand for?](http://stackoverflow.com/questions/1436424/what-does-javascript-stand-for) and [>> in javascript](http://stackoverflow.com/questions/4437169/in-javascript) and many others. – James Allardice Nov 20 '13 at 11:13
  • as mentioned about it is a bitwise operator : Check http://www.tutorialspoint.com/cgi-bin/practice.cgi?file=javascript_bitwise_operators – Prabhuram Nov 20 '13 at 11:16
  • apologies didn't come up when I searched here or in google. – Futile32 Nov 20 '13 at 11:26

1 Answers1

2

It's a bitwise "Sign-propagating right shift" operator.

Shifts a in binary representation b (< 32) bits to the right, discarding bits shifted off.

Examples:

8          (1000)
8 >> 1 = 4 (0100)
8 >> 2 = 2 (0010)
8 >> 3 = 1 (0001)
8 >> 4 = 0 (0000)
h2ooooooo
  • 39,111
  • 8
  • 68
  • 102