类 MathUtil


  • public final class MathUtil
    extends Object
    This util class can make some formal calculation.
    • 方法详细资料

      • Factorial

        public static long Factorial​(int n)
        Calc the factorial of n
        参数:
        n - The number N should greater or equal to 0
        返回:
        The result of factorial n
        抛出:
        RuntimeException - The n should greater or equal to 0
      • Sum

        public static double Sum​(Collection<? extends Number> numbers)
        Get the sum of the numbers
        参数:
        numbers - The numbers
        返回:
        The sum value of the numbers
      • Average

        public static double Average​(Collection<? extends Number> numbers)
        Get the average value of the numbers
        参数:
        numbers - The numbers
        返回:
        The average value of the numbers
      • IsBetween

        public static boolean IsBetween​(Number num,
                                        Number noLess,
                                        Number noGreater)
        Check the num whether is between the noLess and noGreater number
        参数:
        num - The number
        noLess - The num should not less than this number.
        noGreater - The num should not bigger than this number.
        返回: