Package dev.nm.misc

Class Constants


  • public class Constants
    extends Object
    This class lists the global parameters and constants in this nmdev library.
    • Field Detail

      • MACH_EPS

        public static final double MACH_EPS
        the machine epsilon

        This is the difference between 1 and the smallest exactly representable number greater than 1.

        See Also:
        Wikipedia: Machine epsilon
      • MACH_SCALE

        public static final int MACH_SCALE
        the scale for the machine epsilon
      • EPSILON

        public static final double EPSILON
        the default epsilon used in this library
      • ROOT_2

        public static final double ROOT_2
        \(\sqrt{2}\)
      • ROOT_2_PI

        public static final double ROOT_2_PI
        \(\sqrt{2\pi}\)
      • ROOT_PI

        public static final double ROOT_PI
        \(\sqrt{\pi}\)
    • Method Detail

      • unitRoundOff

        public static double unitRoundOff​(int base,
                                          int precision)
        Get the unit round off as defined in the reference.
        Parameters:
        base - base, e.g., 10
        precision - precision (number of digits)
        Returns:
        the unit round off
      • unitRoundOff

        public static double unitRoundOff()
        Get the default unit round off.
        Returns:
        the default unit round off