public class ExtendedMath
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
DOUBLE_PRECISION_SIGNIFICAND_ONLY
The constant value of a double representation that has all bits as
1 except the sign bit, where only the significand contributes to the
value.
|
static double |
DOUBLE_PRECISION_SMALLEST_NORMALIZED_POSITIVE_DOUBLE
The smallest, normalized, positive double value with a double precision.
|
static double |
ONE_OVER_SQRT_2
1 / sqrt(2).
|
static double |
PI_OVER_2
PI / 2.
|
static double |
PI_OVER_4
PI / 4.
|
static double |
SINGLE_PRECISION_SIGNIFICAND_ONLY
The constant value of a double representation that has all bits as
1 except the sign bit, where only the significand contributes to the
value.
|
static double |
SINGLE_PRECISION_SMALLEST_NORMALIZED_POSITIVE_DOUBLE
The smallest, normalized, positive double value with a single precision.
|
static double |
SQRT_2
sqrt(2).
|
Constructor and Description |
---|
ExtendedMath() |
Modifier and Type | Method and Description |
---|---|
static double |
acosh(double x)
Return the inverse hyperbolic cosine of the argument.
|
static double |
asinh(double x)
Return the inverse hyperbolic sine of the argument.
|
static double |
cosh(double x)
Return the hyperbolic cosine of the argument.
|
static int |
gcd(int u,
int v)
Implement Euclid's method for finding the Greatest Common Divisor
(GCD) of
two numbers.
|
static double |
log10(double x)
Return the base-10 logarithm of the argument.
|
static double |
log2(double x)
Return the base-2 logarithm of the argument.
|
static double |
remainder(double f1,
double f2)
Compute the remainder after dividing the first argument by the
second argument as prescribed by the IEEE 754 standard.
|
static int |
roundToInt(double x)
Round to the nearest integer.
|
static int |
sgn(double x)
If the argument is less than zero, return -1, otherwise
return 1.
|
static double |
sinh(double x)
Return the hyperbolic sine of the argument.
|
static double |
tanh(double x)
Return the hyperbolic tangent of the argument.
|
public static final double SQRT_2
public static final double ONE_OVER_SQRT_2
public static final double PI_OVER_2
public static final double PI_OVER_4
public static final double SINGLE_PRECISION_SMALLEST_NORMALIZED_POSITIVE_DOUBLE
public static final double DOUBLE_PRECISION_SMALLEST_NORMALIZED_POSITIVE_DOUBLE
public static final double DOUBLE_PRECISION_SIGNIFICAND_ONLY
public static final double SINGLE_PRECISION_SIGNIFICAND_ONLY
public static final double acosh(double x)
public static final double asinh(double x)
public static final double cosh(double x)
public static int gcd(int u, int v)
public static final double log10(double x)
public static final double log2(double x)
public static double remainder(double f1, double f2)
"The remainder value is mathematically equal to f1 - f2 × n, where n is the mathematical integer closest to the exact mathematical value of the quotient f1/f2, and if two mathematical integers are equally close to f1/f2, then n is the integer that is even. If the remainder is zero, its sign is the same as the sign of the first argument. Special cases:
public static final int roundToInt(double x)
x
- The number to round.public static final int sgn(double x)
public static final double sinh(double x)
public static final double tanh(double x)