public static boolean fastIsInt(
      int fastSignum, long fast0, long fast1, long fast2,
      int fastIntegerDigitCount, int fastScale) {

    if (fastIntegerDigitCount < MAX_INT_DIGITS) {

      // Definitely a int; most ints fall here
      return true;

    } else if (fastIntegerDigitCount > MAX_INT_DIGITS) {

      // Definitely not an int.
      return false;

    } else if (fastScale == 0) {
      if (fast1 != 0 || fast2 != 0) {
        return false;
      }
      if (fastSignum == 1) {
        return (fast0 <= Integer.MAX_VALUE);
      } else {
        return (-fast0 >= Integer.MIN_VALUE);
      }
    } else {

      // We need to work a little harder for our comparison.  Note we round down for
      // integer conversion so anything below the next min/max will work.

      if (fastSignum == 1) {
        return
            (fastCompareTo(
                fastSignum, fast0, fast1, fast2, fastScale,
                FASTHIVEDECIMAL_MAX_INT_VALUE_PLUS_ONE) < 0);
      } else {
        return
            (fastCompareTo(
                fastSignum, fast0, fast1, fast2, fastScale,
                FASTHIVEDECIMAL_MIN_INT_VALUE_MINUS_ONE) > 0);
      }
    }
  }
Is the decimal value a int? Range -2,147,483,648     to   2,147,483,647.
                                  Integer.MIN_VALUE       Integer.MAX_VALUE

Emulates testing for no value corruption:
     bigDecimalValue().setScale(0).equals(BigDecimal.valueOf(bigDecimalValue().intValue()))

NOTE: Fractional digits are ignored in the test since fastIntValueClip() will
      remove them (round down).

@param fastSignum the sign (-1, 0, or +1)
@param fast0 word 0 of the internal representation
@param fast1 word 1
@param fast2 word 2
@param fastIntegerDigitCount the number of integer digits
@param fastScale the scale of the number
@return True when fastIntValueClip() will return a correct int.
storage-api/src/java/org/apache/hadoop/hive/common/type/FastHiveDecimalImpl.java