Package com.vividsolutions.jump.util
Class MathUtil
- java.lang.Object
-
- com.vividsolutions.jump.util.MathUtil
-
-
Constructor Summary
Constructors Constructor Description MathUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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
-
-
-
Method Detail
-
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
-
-