Class NumberUtils


  • public class NumberUtils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static double TheNaN  
    • Constructor Summary

      Constructors 
      Constructor Description
      NumberUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static double doubleEps()  
      (package private) static double doubleMax()  
      (package private) static long doubleToInt64Bits​(double d)  
      (package private) static int hash​(double d)  
      (package private) static int hash​(int n)  
      (package private) static int hash​(int hash, double d)  
      (package private) static int hash​(int hashIn, int n)  
      static int hashCombine​(int hash1, int hash2)  
      (package private) static int intMax()  
      (package private) static boolean isEqualNonIEEE​(double a, double b)
      Returns true if two values are equal (also can compare inf and nan).
      (package private) static boolean isEqualNonIEEE​(double a, double b, double tolerance)
      Returns true if two values are equal (also can compare inf and nan).
      (package private) static boolean isNaN​(double d)  
      (package private) static double NaN()  
      (package private) static double negativeInf()  
      (package private) static int nextRand​(int prevRand)  
      (package private) static double positiveInf()  
      (package private) static int sizeOf​(byte v)  
      (package private) static int sizeOf​(double v)  
      (package private) static int sizeOf​(int v)  
      (package private) static int sizeOf​(long v)  
      (package private) static int sizeOfDouble()  
      static double snap​(double v, double minv, double maxv)  
      static int snap​(int v, int minv, int maxv)  
      static long snap​(long v, long minv, long maxv)  
      • Methods inherited from class java.lang.Object

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

      • NumberUtils

        public NumberUtils()
    • Method Detail

      • snap

        public static int snap​(int v,
                               int minv,
                               int maxv)
      • snap

        public static long snap​(long v,
                                long minv,
                                long maxv)
      • snap

        public static double snap​(double v,
                                  double minv,
                                  double maxv)
      • sizeOf

        static int sizeOf​(double v)
      • sizeOfDouble

        static int sizeOfDouble()
      • sizeOf

        static int sizeOf​(int v)
      • sizeOf

        static int sizeOf​(long v)
      • sizeOf

        static int sizeOf​(byte v)
      • isNaN

        static boolean isNaN​(double d)
      • NaN

        static double NaN()
      • hashCombine

        public static int hashCombine​(int hash1,
                                      int hash2)
      • hash

        static int hash​(int n)
      • hash

        static int hash​(double d)
      • hash

        static int hash​(int hashIn,
                        int n)
      • hash

        static int hash​(int hash,
                        double d)
      • doubleToInt64Bits

        static long doubleToInt64Bits​(double d)
      • negativeInf

        static double negativeInf()
      • positiveInf

        static double positiveInf()
      • intMax

        static int intMax()
      • doubleEps

        static double doubleEps()
      • doubleMax

        static double doubleMax()
      • nextRand

        static int nextRand​(int prevRand)
      • isEqualNonIEEE

        static boolean isEqualNonIEEE​(double a,
                                      double b)
        Returns true if two values are equal (also can compare inf and nan).
      • isEqualNonIEEE

        static boolean isEqualNonIEEE​(double a,
                                      double b,
                                      double tolerance)
        Returns true if two values are equal (also can compare inf and nan).