presto-main/src/main/java/io/prestosql/type/DecimalOperators.java/DecimalOperators/rescaleFactor
class DecimalOperators:    private static int rescaleFactor(long fromScale, long toScale)
    {
        return max(0, (int) toScale - (int) fromScale);
    }