public class AbsoluteErrorBound extends Object implements FloatingPointTolerance
Specifically, for two values v1
and v2
and a
non-negative bound e
, it is checked whether
Math.abs(v1 - v2) <= e
RelativeErrorBound
,
UlpDistanceBound
EXACT
Constructor and Description |
---|
AbsoluteErrorBound(double epsilon)
Define a fixed bound on the absolute error of two floating point
numbers.
|
Modifier and Type | Method and Description |
---|---|
double |
getEpsilon()
Gets the maximum absolute difference allowed between 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 AbsoluteErrorBound(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)
FloatingPointTolerance
isWithinTolerance
in interface FloatingPointTolerance
value1
- the first value to comparevalue2
- the second value to comparetrue
if the two values lie with the error bounds,
otherwise false
public boolean isWithinTolerance(double value1, double value2)
FloatingPointTolerance
isWithinTolerance
in interface FloatingPointTolerance
value1
- the first value to comparevalue2
- the second value to comparetrue
if the two values lie with the error bounds,
otherwise false
public boolean isWithinTolerance(BigDecimal value1, BigDecimal value2)
FloatingPointTolerance
isWithinTolerance
in interface FloatingPointTolerance
value1
- the first value to comparevalue2
- the second value to comparetrue
if the two values lie with the error bounds,
otherwise false
public double getEpsilon()
Copyright © 2020 Actian Corporation. All rights reserved.