Class Mathx


  • public class Mathx
    extends Object
    Author:
    olafdavid
    • 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)