Class Maths


  • public final class Maths
    extends java.lang.Object
    Misc math utilities.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Maths()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long add​(long a, long b)
      Returns the sum of a and b else Long.MAX_VALUE if the sum would otherwise overflow.
      static long roundDown​(long input, long interval)
      Returns the input rounded down to the nearest interval.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Maths

        private Maths()
    • Method Detail

      • add

        public static long add​(long a,
                               long b)
        Returns the sum of a and b else Long.MAX_VALUE if the sum would otherwise overflow.
      • roundDown

        public static long roundDown​(long input,
                                     long interval)
        Returns the input rounded down to the nearest interval.