com.softicar.platform.common.math.arithmetic.DoubleArithmetic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.math.arithmetic;
/**
* Implementation of {@link IArithmetic} for {@link Double}.
*
* @author Oliver Richers
*/
class DoubleArithmetic implements IArithmetic {
private static final Double ZERO = 0.0;
private static final Double ONE = 1.0;
@Override
public Double getZero() {
return ZERO;
}
@Override
public Double getOne() {
return ONE;
}
@Override
public Double plus(Double left, Double right) {
return left + right;
}
@Override
public Double minus(Double left, Double right) {
return left - right;
}
@Override
public Double times(Double left, Double right) {
return left * right;
}
@Override
public Double divided(Double left, Double right) {
return left / right;
}
@Override
public Double negate(Double value) {
return -value;
}
@Override
public int compare(Double left, Double right) {
return Double.compare(left, right);
}
}