Package oms3.ngmf.ui.calc
Class Mathx
- java.lang.Object
-
- oms3.ngmf.ui.calc.Mathx
-
public class Mathx extends Object
- Author:
- olafdavid
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intlen(double[] arr)Length of an arraystatic intlen(int[] arr)static doubleramp(double start, double incr)static doublerandom(double min, double max)static voidreset_ramp()static doubleround(double val, int places)Round a double value to a specified number of decimal places.static floatround(float val, int places)Round a float value to a specified number of decimal places.
-
-
-
Method Detail
-
round
public static double round(double val, int places)Round a double value to a specified number of decimal places.- Parameters:
val- the value to be rounded.places- the number of decimal places to round to.- Returns:
- val rounded to places decimal places.
-
round
public static float round(float val, int places)Round a float value to a specified number of decimal places.- Parameters:
val- the value to be rounded.places- the number of decimal places to round to.- Returns:
- val rounded to places decimal places.
-
len
public static int len(double[] arr)
Length of an array- Parameters:
arr-- Returns:
-
len
public static int len(int[] arr)
-
random
public static double random(double min, double max)
-
reset_ramp
public static void reset_ramp()
-
ramp
public static double ramp(double start, double incr)
-
-