All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.math.arithmetic.DoubleArithmetic Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
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);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy