class DoubleOperations implements MathOperations<Double>, Comparator<Double> {

    @Override
    public Double keepSignificantFigures( Double value,
                                          int numSigFigs ) {
        if (numSigFigs < 0) return value;
        if (numSigFigs == 0) return 0.0d;
        int currentExp = getExponentInScientificNotation(value);
        int decimalShift = -currentExp + numSigFigs - 1;
        return roundUp(value, decimalShift);
    }

}