presto-main/src/main/java/io/prestosql/operator/scalar/MathFunctions.java/MathFunctions/roundLong
class MathFunctions:    private static long roundLong(long num, long decimals)
    {
        if (decimals >= 0) {
            return num;
        }

        try {
            long factor = LongMath.checkedPow(10, toIntExact(-decimals));
            return Math.multiplyExact(LongMath.divide(num, factor, RoundingMode.HALF_UP), factor);
        }
        catch (ArithmeticException e) {
            throw new PrestoException(NUMERIC_VALUE_OUT_OF_RANGE, "numerical overflow: " + num, e);
        }
    }