public class DoubleUtilities extends Object
double
.Modifier and Type | Method and Description |
---|---|
static boolean |
areEqual(double value1,
double value2)
Are the two numbers equal, within a tolerance?
|
static double |
divideByZeroReplace(double numerator,
double denominator,
double replaceWithIfZero)
Replaces a value with a constant if the
denominator is 0. |
public static boolean areEqual(double value1, double value2)
The tolerance is .
value1
- the first value.value2
- the second value.value1
and value2
differ by less than PrecisionConstants.EPSILON
.public static double divideByZeroReplace(double numerator, double denominator, double replaceWithIfZero)
denominator
is 0.numerator
- numerator.denominator
- denominator.replaceWithIfZero
- what to replace with if zero.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.