Class MathUtils


  • public class MathUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double mean​(java.util.List<java.lang.Double> data)
      calculate mean of list
      static double popStdDev​(java.util.List<java.lang.Double> data)
      calculate pop std dev of list
      static double popVariance​(java.util.List<java.lang.Double> data)
      calculate pop variance of list
      static double roundWithGivenPrecision​(double data)  
      static double roundWithGivenPrecision​(double data, int size)  
      static float roundWithGivenPrecision​(float data)  
      static float roundWithGivenPrecision​(float data, int size)  
      static double sum​(java.util.List<java.lang.Double> data)
      calculate sum of list
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • roundWithGivenPrecision

        public static float roundWithGivenPrecision​(float data,
                                                    int size)
        Parameters:
        data - data should be less than Long.MAX_VALUE. otherwise Math.round() will return wrong value.
      • roundWithGivenPrecision

        public static float roundWithGivenPrecision​(float data)
      • roundWithGivenPrecision

        public static double roundWithGivenPrecision​(double data,
                                                     int size)
        Parameters:
        data - data should be less than Long.MAX_VALUE. otherwise Math.round() will return wrong value.
      • roundWithGivenPrecision

        public static double roundWithGivenPrecision​(double data)
        Parameters:
        data - data should be less than Long.MAX_VALUE. otherwise Math.round() will return wrong value.
      • sum

        public static double sum​(java.util.List<java.lang.Double> data)
        calculate sum of list
        Parameters:
        data - need to calculate list
        Returns:
        sum of list
      • mean

        public static double mean​(java.util.List<java.lang.Double> data)
        calculate mean of list
        Parameters:
        data - need to calculate list
        Returns:
        mean of list
      • popVariance

        public static double popVariance​(java.util.List<java.lang.Double> data)
        calculate pop variance of list
        Parameters:
        data - need to calculate list
        Returns:
        pop variance of list
      • popStdDev

        public static double popStdDev​(java.util.List<java.lang.Double> data)
        calculate pop std dev of list
        Parameters:
        data - need to calculate list
        Returns:
        pop std dev of list