Class BasicCalculator
java.lang.Object
ch.nolix.base.math.basic.BasicCalculator
- All Implemented Interfaces:
IBasicCalculator
- Author:
- Silvan Wyss
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetAbsoluteDifference(double value1, double value2) intgetAbsoluteDifference(int value1, int value2) longgetAbsoluteDifference(long value1, long value2) doublegetAbsoluteValue(double value) The absolute value of a value x is -x if x is negative, x otherwise.intgetAbsoluteValue(int value) The absolute value of a value x is -x if x is negative, x otherwise.longgetAbsoluteValue(long value) The absolute value of a value x is -x if x is negative, x otherwise.doublegetAverage(double... values) intgetAverage(int... values) longgetAverage(long... values) doublegetAverage(Iterable<Double> values) doublegetMax(double... values) intgetMax(int... values) longgetMax(long... values) doublegetMin(double... values) intgetMin(int... values) longgetMin(long... values) doublegetSquare(double value) doublegetSquare(int value) doublegetSquare(long value) doublegetSum(double... values) intgetSum(int... values) longgetSum(long... values) double
-
Constructor Details
-
BasicCalculator
public BasicCalculator()
-
-
Method Details
-
getAbsoluteDifference
public double getAbsoluteDifference(double value1, double value2) - Specified by:
getAbsoluteDifferencein interfaceIBasicCalculator- Parameters:
value1-value2-- Returns:
- the absolute difference between the given 2 values.
-
getAbsoluteDifference
public int getAbsoluteDifference(int value1, int value2) - Specified by:
getAbsoluteDifferencein interfaceIBasicCalculator- Parameters:
value1-value2-- Returns:
- the absolute difference between the given 2 values.
-
getAbsoluteDifference
public long getAbsoluteDifference(long value1, long value2) - Specified by:
getAbsoluteDifferencein interfaceIBasicCalculator- Parameters:
value1-value2-- Returns:
- the absolute difference between the given 2 values.
-
getAbsoluteValue
public double getAbsoluteValue(double value) The absolute value of a value x is -x if x is negative, x otherwise.- Specified by:
getAbsoluteValuein interfaceIBasicCalculator- Parameters:
value-- Returns:
- the absolute value of the given value.
-
getAbsoluteValue
public int getAbsoluteValue(int value) The absolute value of a value x is -x if x is negative, x otherwise.- Specified by:
getAbsoluteValuein interfaceIBasicCalculator- Parameters:
value-- Returns:
- the absolute value of the given value.
-
getAbsoluteValue
public long getAbsoluteValue(long value) The absolute value of a value x is -x if x is negative, x otherwise.- Specified by:
getAbsoluteValuein interfaceIBasicCalculator- Parameters:
value-- Returns:
- the absolute value of the given value.
-
getAverage
public double getAverage(double... values) - Specified by:
getAveragein interfaceIBasicCalculator- Parameters:
values-- Returns:
- the average of the given values.
-
getAverage
- Specified by:
getAveragein interfaceIBasicCalculator- Parameters:
values-- Returns:
- the average of the given values.
-
getAverage
public int getAverage(int... values) - Specified by:
getAveragein interfaceIBasicCalculator- Parameters:
values-- Returns:
- the average of the given values.
-
getAverage
public long getAverage(long... values) - Specified by:
getAveragein interfaceIBasicCalculator- Parameters:
values-- Returns:
- the average of the given values.
-
getMax
public double getMax(double... values) - Specified by:
getMaxin interfaceIBasicCalculator- Parameters:
values-- Returns:
- the biggest value of the given values.
-
getMax
public int getMax(int... values) - Specified by:
getMaxin interfaceIBasicCalculator- Parameters:
values-- Returns:
- the biggest value of the given values.
-
getMax
public long getMax(long... values) - Specified by:
getMaxin interfaceIBasicCalculator- Parameters:
values-- Returns:
- the biggest value of the given values.
-
getMin
public double getMin(double... values) - Specified by:
getMinin interfaceIBasicCalculator- Parameters:
values-- Returns:
- the smallest value of the given values.
-
getMin
public int getMin(int... values) - Specified by:
getMinin interfaceIBasicCalculator- Parameters:
values-- Returns:
- the smallest value of the given values.
-
getMin
public long getMin(long... values) - Specified by:
getMinin interfaceIBasicCalculator- Parameters:
values-- Returns:
- the smallest value of the given values.
-
getSquare
public double getSquare(double value) - Specified by:
getSquarein interfaceIBasicCalculator- Parameters:
value-- Returns:
- the square of the given value.
-
getSquare
public double getSquare(int value) - Specified by:
getSquarein interfaceIBasicCalculator- Parameters:
value-- Returns:
- the square of the given value.
-
getSquare
public double getSquare(long value) - Specified by:
getSquarein interfaceIBasicCalculator- Parameters:
value-- Returns:
- the square of the given value.
-
getSum
public double getSum(double... values) - Specified by:
getSumin interfaceIBasicCalculator- Parameters:
values-- Returns:
- the sum of the given values.
-
getSum
public int getSum(int... values) - Specified by:
getSumin interfaceIBasicCalculator- Parameters:
values-- Returns:
- the sum of the given values.
-
getSum
- Specified by:
getSumin interfaceIBasicCalculator- Parameters:
values-- Returns:
- the sum of the given values.
-
getSum
public long getSum(long... values) - Specified by:
getSumin interfaceIBasicCalculator- Parameters:
values-- Returns:
- the sum of the given values.
-