public static int previousSetBit(long v,int start){
  if (start == -1 || start >= Long.SIZE) {
    return -1;
  }
  long cur=v & (LONG_ALL_BITS >>> start);
  if (cur == 0) {
    return -1;
  }
  return Long.SIZE - 1 - Long.numberOfLeadingZeros(cur);
}

public static int previousSetBit ( long v , int start ) { if ( start == - 1 || start >= Long . SIZE ) { return - 1 ; } long cur = v & ( LONG_ALL_BITS > > > start ) ; if ( cur == 0 ) { return - 1 ; } return Long . SIZE - 1 - Long . numberOfLeadingZeros ( cur ) ; }
find the previous set bit .
