public static int numberOfLeadingZerosSigned(long[] v){
  for (int p=0, ip=v.length - 1; ; p++, ip--) {
    if (p == v.length) {
      return -1;
    }
    if (v[ip] != 0) {
      return Long.numberOfLeadingZeros(v[ip]) + p * Long.SIZE;
    }
  }
}

public static int numberOfLeadingZerosSigned ( long [ ] v ) { for ( int p = 0 , ip = v . length - 1 ; ; p ++ , ip -- ) { if ( p == v . length ) { return - 1 ; } if ( v [ ip ] != 0 ) { return Long . numberOfLeadingZeros ( v [ ip ] ) + p * Long . SIZE ; } } }
find the number of leading zeros .
