private Text evaluateInternal(double n) {
    if (n == 0.0d) {
      result.set(nulString);
      return result;
    }
    if (n < 0.0d) {
      result.set("");
      return result;
    }

    // Should only down-cast and elimination precision if within valid range.
    return evaluateInternal((short) n);
  }
UDFChr converts an integer into its ASCII equivalent.
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFChr.java