public class RelativeErrorBound extends Object implements FloatingPointTolerance
Specifically, for two values v1 and v2 where v1 > v2
and a non-negative bound e, it is checked whether
Math.abs((v1 - v2)/v1) <= e
EXACT| Constructor and Description |
|---|
RelativeErrorBound(double epsilon)
Define a fixed bound on the relative error of two floating point
numbers.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getEpsilon()
Gets the maximum percentage difference allowed between two values.
|
boolean |
isWithinTolerance(BigDecimal value1,
BigDecimal value2)
Indicates whether the specified values are equal under the tolerance.
|
boolean |
isWithinTolerance(double value1,
double value2)
Indicates whether the specified values are equal under the tolerance.
|
boolean |
isWithinTolerance(float value1,
float value2)
Indicates whether the specified values are equal under the tolerance.
|
public RelativeErrorBound(double epsilon)
epsilon - the fixed bound on the errorcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException - if epsilon is
negative.public boolean isWithinTolerance(float value1,
float value2)
FloatingPointToleranceisWithinTolerance in interface FloatingPointTolerancevalue1 - the first value to comparevalue2 - the second value to comparetrue if the two values lie with the error bounds,
otherwise falsepublic boolean isWithinTolerance(double value1,
double value2)
FloatingPointToleranceisWithinTolerance in interface FloatingPointTolerancevalue1 - the first value to comparevalue2 - the second value to comparetrue if the two values lie with the error bounds,
otherwise falsepublic boolean isWithinTolerance(BigDecimal value1, BigDecimal value2)
FloatingPointToleranceisWithinTolerance in interface FloatingPointTolerancevalue1 - the first value to comparevalue2 - the second value to comparetrue if the two values lie with the error bounds,
otherwise falsepublic double getEpsilon()
Copyright © 2016 Actian Corporation. All rights reserved.