|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.evanmclean.evlib.misc.Dbl
public final class Dbl
Functions for checking the values of doubles are 'close enough'.
| Method Summary | |
|---|---|
static boolean |
equiv(double lhs,
double rhs)
Returns true if the difference between the two doubles is less
than 0.000001. |
static boolean |
equiv(double lhs,
double rhs,
int tolerance)
Returns true if the difference between the two doubles is
within a certain tolerance. |
static boolean |
zero(double val)
Return true if the value is less than +/-0.000001. |
static boolean |
zero(double val,
int tolerance)
Return true if the value is within a certain range, either
side of zero. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean equiv(double lhs,
double rhs)
true if the difference between the two doubles is less
than 0.000001.
lhs - rhs -
true if the difference between the two doubles
is less than 0.000001.
public static boolean equiv(double lhs,
double rhs,
int tolerance)
true if the difference between the two doubles is
within a certain tolerance.
lhs - rhs - tolerance -
true if the difference between the two doubles
is less than Math.pow(10, -tolerance).public static boolean zero(double val)
true if the value is less than +/-0.000001.
val -
true if the value is less than +/-0.000001.
public static boolean zero(double val,
int tolerance)
true if the value is within a certain range, either
side of zero.
val - tolerance -
true if the value is less than +/-
Math.pow(10.0, -tolerance)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||