public static interface Precision.DoubleEquivalence
| Modifier and Type | Method and Description |
|---|---|
int |
compare(double a,
double b)
Compares two values.
|
default boolean |
eq(double a,
double b)
Indicates whether given values are considered equal to each other.
|
default boolean |
eqZero(double a)
Indicates whether the given value is considered equal to zero.
|
default boolean |
gt(double a,
double b)
Indicates whether the first argument is strictly greater than the second.
|
default boolean |
gte(double a,
double b)
Indicates whether the first argument is greater than or considered equal to the second.
|
default boolean |
lt(double a,
double b)
Indicates whether the first argument is strictly smaller than the second.
|
default boolean |
lte(double a,
double b)
Indicates whether the first argument is smaller or considered equal to the second.
|
default double |
signum(double a)
Returns the
sign of the argument. |
default boolean eq(double a, double b)
a - Value.b - Value.default boolean eqZero(double a)
eq(a, 0.0).a - Value.default boolean lt(double a, double b)
a - Value.b - Value.a < bdefault boolean lte(double a, double b)
a - Value.b - Value.a <= bdefault boolean gt(double a, double b)
a - Value.b - Value.a > bdefault boolean gte(double a, double b)
a - Value.b - Value.a >= bdefault double signum(double a)
sign of the argument.
The returned value is
-0.0 if a is considered equal to zero and negatively signed,+0.0 if a is considered equal to zero and positively signed,-1.0 if a is considered less than zero,+1.0 if a is considered greater than zero.The equality with zero uses the eqZero method.
a - Value.a if a == 0 or
a is NaN).eqZero(double)int compare(double a, double b)
0 if the arguments are considered equal,-1 if a < b,+1 if a > b or if either value is NaN.a - Value.b - Value.0 if the values are considered equal, -1
if the first is smaller than the second, 1 is the first
is larger than the second or either value is NaN.Copyright © 2017–2022 The Apache Software Foundation. All rights reserved.