INNER CODE UNIT · Java
Calculator
SeaseLtd/rated-ranking-evaluator · rre-core/src/main/java/io/sease/rre/Calculator.java:31
public abstract class Calculator {
/**
* Executes the sum of the given addends.
*
* @param addends the numbers that will be added together.
* @return the sum of all input addends.
*/
public static BigDecimal sum(final BigDecimal... addends) {
return stream(addends).reduce(BigDecimal.ZERO, BigDecimal::add);
}
/**
* Returns the product of a numbers set.
*
* @param numbers the numbers that will be added together.
* @return the product of all input numbers.
*/
public static BigDecimal multiply(final BigDecimal... numbers) {