class LongOperations implements MathOperations<Long>, Comparator<Long> {

    @Override
    public Long roundDown( Long value,
                           int decimalShift ) {
        if (value == 0) return 0l;
        if (decimalShift >= 0) return value;
        long shiftedValue = Math.abs(value);
        for (int i = 0; i != -decimalShift; ++i)
            shiftedValue /= 10l;
        shiftedValue *= Long.signum(value);
        for (int i = 0; i != -decimalShift; ++i)
            shiftedValue *= 10l;
        return shiftedValue;
    }

}