Class MathUtil
java.lang.Object
com.vividsolutions.jump.util.MathUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleavg(double a, double b) Returns the average of two doublesstatic doublebase10Log(double x) static intmostSignificantDigit(double x) static doubleorderOfMagnitude(double x) static doubleround(double value, int places) round a double tonumber for instance round(123.4567 , 2) -> 123.45
-
Constructor Details
-
MathUtil
public MathUtil()
-
-
Method Details
-
orderOfMagnitude
public static double orderOfMagnitude(double x) -
base10Log
public static double base10Log(double x) -
mostSignificantDigit
public static int mostSignificantDigit(double x) -
avg
public static double avg(double a, double b) Returns the average of two doubles- Parameters:
a- one of the doubles to averageb- the other double to average- Returns:
- the average of two doubles
-
round
public static double round(double value, int places) round a double tonumber for instance round(123.4567 , 2) -> 123.45 - Parameters:
value- the value to roundplaces- number of decimal places- Returns:
- a double rounded to "places" decimals
-