Class ExtraMath


  • public class ExtraMath
    extends java.lang.Object
    A static utility class with two additional math functions.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double CLOSE  
      static double EPSILON  
      static double LOG10  
    • Constructor Summary

      Constructors 
      Constructor Description
      ExtraMath()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean close​(double v, double w)  
      static boolean close​(double v, double w, double tol)
      Are v and w "close" to each other?
      static double closeFloor​(double v)
      Returns floor(v) except when v is very close to the next number, when it returns ceil(v);
      static double hypot​(double v, double w)  
      static double log10​(double v)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG10

        public static double LOG10
      • EPSILON

        public static double EPSILON
      • CLOSE

        public static double CLOSE
    • Constructor Detail

      • ExtraMath

        public ExtraMath()
    • Method Detail

      • log10

        public static double log10​(double v)
      • hypot

        public static double hypot​(double v,
                                   double w)
      • close

        public static boolean close​(double v,
                                    double w,
                                    double tol)
        Are v and w "close" to each other? Uses a scaled tolerance.
      • close

        public static boolean close​(double v,
                                    double w)
      • closeFloor

        public static double closeFloor​(double v)
        Returns floor(v) except when v is very close to the next number, when it returns ceil(v);