Package dev.nm.misc
Class Constants
- java.lang.Object
-
- dev.nm.misc.Constants
-
public class Constants extends Object
This class lists the global parameters and constants in this nmdev library.
-
-
Field Summary
Fields Modifier and Type Field Description static doubleAPERYthe Apery's constantstatic doubleEPSILONthe default epsilon used in this librarystatic doubleEULER_MASCHERONIthe Euler-Mascheroni constantstatic doubleGOLDEN_RATIOthe Golden ratiostatic doubleMACH_EPSthe machine epsilonstatic intMACH_SCALEthe scale for the machine epsilonstatic doublePI_SQ\(\pi^2\)static doubleROOT_2\(\sqrt{2}\)static doubleROOT_2_PI\(\sqrt{2\pi}\)static doubleROOT_PI\(\sqrt{\pi}\)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleunitRoundOff()Get the default unit round off.static doubleunitRoundOff(int base, int precision)Get the unit round off as defined in the reference.
-
-
-
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}\)
-
PI_SQ
public static final double PI_SQ
\(\pi^2\)- See Also:
- Constant Field Values
-
EULER_MASCHERONI
public static final double EULER_MASCHERONI
the Euler-Mascheroni constant
-
APERY
public static final double APERY
the Apery's constant- See Also:
- Wikipedia: Apery's constant, Constant Field Values
-
GOLDEN_RATIO
public static final double GOLDEN_RATIO
the Golden ratio- See Also:
- Wikipedia: Golden ratio
-
-
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., 10precision- 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
-
-