In reviewing “Crossfilter” source I came across a function that used >>. Below is the function :
// Similar to bisectLeft, but returns an insertion point which comes after (to
// the right of) any existing entries of x in a.
//
// The returned insertion point i partitions the array into two halves so that
// all v <= x for v in a[lo:i] for the left side and all v > x for v in
// a[i:hi] for the right side.
function bisectRight(a, x, lo, hi) {
while (lo < hi) {
var mid = lo + hi >> 1;
if (x < f(a[mid])) hi = mid;
else lo = mid + 1;
}
return lo;
}
Google isn’t returning any results and I have never seen this before. Thanks in advance for the help.
Bitwise shift, see https://developer.mozilla.org/en/JavaScript/Reference/Operators/Bitwise_Operators