presto-spi/src/main/java/io/prestosql/spi/type/DecimalConversions.java/DecimalConversions/realToShortDecimal
class DecimalConversions:    public static long realToShortDecimal(long value, long precision, long scale)
    {
        // TODO: implement specialized version for short decimals
        Slice decimal = realToLongDecimal(value, precision, scale);

        long low = UnscaledDecimal128Arithmetic.getLong(decimal, 0);
        long high = UnscaledDecimal128Arithmetic.getLong(decimal, 1);

        checkState(high == 0 && low >= 0, "Unexpected long decimal");

        if (UnscaledDecimal128Arithmetic.isNegative(decimal)) {
            return -low;
        }
        else {
            return low;
        }
    }