Package org.apache.iotdb.db.utils
Class MathUtils
- java.lang.Object
-
- org.apache.iotdb.db.utils.MathUtils
-
public class MathUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublemean(java.util.List<java.lang.Double> data)calculate mean of liststatic doublepopStdDev(java.util.List<java.lang.Double> data)calculate pop std dev of liststatic doublepopVariance(java.util.List<java.lang.Double> data)calculate pop variance of liststatic doubleroundWithGivenPrecision(double data)static doubleroundWithGivenPrecision(double data, int size)static floatroundWithGivenPrecision(float data)static floatroundWithGivenPrecision(float data, int size)static doublesum(java.util.List<java.lang.Double> data)calculate sum of list
-
-
-
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
-
-