Interface IBasicCalculator

All Known Implementing Classes:
BasicCalculator

public interface IBasicCalculator
Author:
Silvan Wyss
  • Method Details

    • getAbsoluteDifference

      double getAbsoluteDifference(double value1, double value2)
      Parameters:
      value1 -
      value2 -
      Returns:
      the absolute difference between the given 2 values.
    • getAbsoluteDifference

      int getAbsoluteDifference(int value1, int value2)
      Parameters:
      value1 -
      value2 -
      Returns:
      the absolute difference between the given 2 values.
    • getAbsoluteDifference

      long getAbsoluteDifference(long value1, long value2)
      Parameters:
      value1 -
      value2 -
      Returns:
      the absolute difference between the given 2 values.
    • getAbsoluteValue

      double getAbsoluteValue(double value)
      The absolute value of a value x is -x if x is negative, x otherwise.
      Parameters:
      value -
      Returns:
      the absolute value of the given value.
    • getAbsoluteValue

      int getAbsoluteValue(int value)
      The absolute value of a value x is -x if x is negative, x otherwise.
      Parameters:
      value -
      Returns:
      the absolute value of the given value.
    • getAbsoluteValue

      long getAbsoluteValue(long value)
      The absolute value of a value x is -x if x is negative, x otherwise.
      Parameters:
      value -
      Returns:
      the absolute value of the given value.
    • getAverage

      double getAverage(double... values)
      Parameters:
      values -
      Returns:
      the average of the given values.
      Throws:
      RuntimeException - if the given values is null or empty.
    • getAverage

      double getAverage(Iterable<Double> values)
      Parameters:
      values -
      Returns:
      the average of the given values.
      Throws:
      RuntimeException - if the given values is null or empty.
    • getAverage

      int getAverage(int... values)
      Parameters:
      values -
      Returns:
      the average of the given values.
      Throws:
      RuntimeException - if the given values is null or empty.
    • getAverage

      long getAverage(long... values)
      Parameters:
      values -
      Returns:
      the average of the given values.
      Throws:
      RuntimeException - if the given values is null or empty.
    • getMax

      double getMax(double... values)
      Parameters:
      values -
      Returns:
      the biggest value of the given values.
      Throws:
      RuntimeException - if the given values is null or empty.
    • getMax

      int getMax(int... values)
      Parameters:
      values -
      Returns:
      the biggest value of the given values.
      Throws:
      RuntimeException - if the given values is null or empty.
    • getMax

      long getMax(long... values)
      Parameters:
      values -
      Returns:
      the biggest value of the given values.
      Throws:
      RuntimeException - if the given values is null or empty.
    • getMin

      double getMin(double... values)
      Parameters:
      values -
      Returns:
      the smallest value of the given values.
      Throws:
      RuntimeException - if the given values is null or empty.
    • getMin

      int getMin(int... values)
      Parameters:
      values -
      Returns:
      the smallest value of the given values.
      Throws:
      RuntimeException - if the given values is null or empty.
    • getMin

      long getMin(long... values)
      Parameters:
      values -
      Returns:
      the smallest value of the given values.
      Throws:
      RuntimeException - if the given values is null or empty.
    • getSquare

      double getSquare(double value)
      Parameters:
      value -
      Returns:
      the square of the given value.
    • getSquare

      double getSquare(int value)
      Parameters:
      value -
      Returns:
      the square of the given value.
    • getSquare

      double getSquare(long value)
      Parameters:
      value -
      Returns:
      the square of the given value.
    • getSum

      double getSum(double... values)
      Parameters:
      values -
      Returns:
      the sum of the given values.
      Throws:
      RuntimeException - if the given values is null.
    • getSum

      int getSum(int... values)
      Parameters:
      values -
      Returns:
      the sum of the given values.
      Throws:
      RuntimeException - if the given values is null.
    • getSum

      double getSum(Iterable<Double> values)
      Parameters:
      values -
      Returns:
      the sum of the given values.
    • getSum

      long getSum(long... values)
      Parameters:
      values -
      Returns:
      the sum of the given values.
      Throws:
      RuntimeException - if the given values is null.