public static int fastHighWordPrecision(
      long longWord) {

    if (longWord == 0) {
      return 0;
    }
    // 6 highword digits.
    if (longWord > 999L) {
      if (longWord > 9999L) {
        if (longWord > 99999L) {
          return 6;
        } else {
          return 5;
        }
      } else {
        return 4;
      }
    } else {
      if (longWord > 99L) {
        return 3;
      } else {
        if (longWord > 9L) {
          return 2;
        } else {
          return 1;
        }
      }
    }
  }
Fast decimal scale up by factor of 10.
@param fast0 word 0 of the internal representation
@param fast1 word 1
@param fast2 word 2
@param scaleUp the number of integer digits to scale up by
@param fastResult an object to reuse
@return was the operation successfule?
storage-api/src/java/org/apache/hadoop/hive/common/type/FastHiveDecimalImpl.java