Klasse BasicCalculator

java.lang.Object
ch.nolix.core.math.basic.BasicCalculator

public final class BasicCalculator extends Object
  • Felddetails

    • DEFAULT_MAX_DEVIATION

      public static final double DEFAULT_MAX_DEVIATION
      The default maximum deviation is 10^-9.
      Siehe auch:
  • Konstruktordetails

    • BasicCalculator

      public BasicCalculator()
  • Methodendetails

    • equalsApproximatively

      public boolean equalsApproximatively(double value1, double value2)
      Parameter:
      value1 -
      value2 -
      Gibt zurück:
      true if the given values equals approximately each other with a deviation that is not bigger than 1.0E-9.
    • equalsApproximatively

      public boolean equalsApproximatively(double value1, double value2, double maxDeviation)
      Parameter:
      value1 -
      value2 -
      maxDeviation -
      Gibt zurück:
      true if the given values equals approximately each other with a deviation that is not bigger than the given maxDeviation.
      Löst aus:
      NegativeArgumentException - if the given maxDeviation is negative.
    • getAbsoluteDifference

      public double getAbsoluteDifference(double value1, double value2)
      Parameter:
      value1 -
      value2 -
      Gibt zurück:
      the absolute difference between the given 2 values.
    • getAbsoluteDifference

      public int getAbsoluteDifference(int value1, int value2)
      Parameter:
      value1 -
      value2 -
      Gibt zurück:
      the absolute difference between the given 2 values.
    • getAbsoluteDifference

      public long getAbsoluteDifference(long value1, long value2)
      Parameter:
      value1 -
      value2 -
      Gibt zurück:
      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.
      Parameter:
      value -
      Gibt zurück:
      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.
      Parameter:
      value -
      Gibt zurück:
      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.
      Parameter:
      value -
      Gibt zurück:
      the absolute value of the given value.
    • getAverage

      public double getAverage(double value, double... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the average of the given values.
    • getAverage

      public double getAverage(Iterable<Double> values)
      Parameter:
      values -
      Gibt zurück:
      the average of the given values.
      Löst aus:
      EmptyArgumentException - if the given values is empty.
    • getAverage

      public int getAverage(int value, int... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the average of the given values.
    • getAverage

      public long getAverage(long value, long... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the average of the given values.
    • getMax

      public double getMax(double value, double... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the biggest value of the given values.
    • getMax

      public int getMax(int value, int... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the biggest value of the given values.
    • getMax

      public long getMax(long value, long... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the biggest value of the given values.
    • getMin

      public double getMin(double value, double... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the smallest value of the given values.
    • getMin

      public int getMin(int value, int... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the smallest value of the given values.
    • getMin

      public long getMin(long value, long... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the smallest value of the given values.
    • getSquare

      public double getSquare(double value)
      Parameter:
      value -
      Gibt zurück:
      the square of the given value.
    • getSquare

      public double getSquare(int value)
      Parameter:
      value -
      Gibt zurück:
      the square of the given value.
    • getSquare

      public double getSquare(long value)
      Parameter:
      value -
      Gibt zurück:
      the square of the given value.
    • getSum

      public double getSum(double value, double... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the sum of the given values.
    • getSum

      public int getSum(int value, int... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the sum of the given values.
    • getSum

      public double getSum(Iterable<Double> values)
      Parameter:
      values -
      Gibt zurück:
      the sum of the given values.
    • getSum

      public long getSum(long value, long... values)
      Parameter:
      value -
      values -
      Gibt zurück:
      the sum of the given values.
    • isApproximatelyOne

      public boolean isApproximatelyOne(double value)
      Parameter:
      value -
      Gibt zurück:
      true if the given value is approximately 1.0 with a deviation that is not bigger than 1.0E-9.
    • isApproximatelyOne

      public boolean isApproximatelyOne(double value, double maxDeviation)
      Parameter:
      value -
      maxDeviation -
      Gibt zurück:
      true if the given value is approximately 1.0 with a deviation that is not bigger than the given maxDeviation.
      Löst aus:
      NegativeArgumentException - if the given maxDeviation is negative.
    • isApproximatelyZero

      public boolean isApproximatelyZero(double value)
      Parameter:
      value -
      Gibt zurück:
      true if the given value is approximately 0.0 with a deviation that is not bigger than 1.0E-9.
    • isApproximatelyZero

      public boolean isApproximatelyZero(double value, double maxDeviation)
      Parameter:
      value -
      maxDeviation -
      Gibt zurück:
      true if the given value is approximately 0.0 with a deviation that is not bigger than the given maxDeviation.
      Löst aus:
      NegativeArgumentException - if the given maxDeviation is negative.