nl_tokens: Binary search implementation ( recursive )
pl_tokens: function binarySearch ( arr , searchValue ) { function find ( arr , searchValue , left , right ) { if ( right < left ) return - 1 ; /*
      int mid = mid = (left + right) / 2;
      There is a bug in the above line;
      Joshua Bloch suggests the following replacement:
      */ var mid = Math . floor ( ( left + <mask> ) >>> 1 ) ; if ( searchValue > arr [ mid ] ) return find ( arr , searchValue , mid + 1 , right ) ; if ( searchValue < arr [ mid ] ) return find ( arr , searchValue , left , mid - 1 ) ; return mid ; } ; return find ( arr , searchValue , 0 , arr . length - 1 ) ; }