public final class MathUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
nearOne(double value,
double tolerance)
Checks if a number is near one.
|
static boolean |
nearZero(double value,
double tolerance)
Checks if a number is near zero.
|
static double |
pow2(double value)
Returns the power of 2 (square).
|
static double |
pow3(double value)
Returns the power of 3 (cube).
|
static double |
pow4(double value)
Returns the power of 4.
|
public static double pow2(double value)
value - the value to checkvalue * valuepublic static double pow3(double value)
value - the value to checkvalue * value * valuepublic static double pow4(double value)
value - the value to checkvalue * value * value * valuepublic static boolean nearZero(double value,
double tolerance)
NaN and infinity are not near zero.
value - the value to checktolerance - the tolerance, must be positive and not NaN/Infinite (not validated)public static boolean nearOne(double value,
double tolerance)
NaN and infinity are not near one.
value - the value to checktolerance - the tolerance, must be positive and not NaN/Infinite (not validated)Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.