Skip to content

Commit

Permalink
Improve EFloat::GetAbsoluteError(). Issue mmp#167
Browse files Browse the repository at this point in the history
  • Loading branch information
mmp committed Oct 12, 2019
1 parent 6f91dec commit 62b9764
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/efloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class EFloat {
}
explicit operator float() const { return v; }
explicit operator double() const { return v; }
float GetAbsoluteError() const { return high - low; }
float GetAbsoluteError() const { return NextFloatUp(std::max(std::abs(high - v),
std::abs(v - low))); }
float UpperBound() const { return high; }
float LowerBound() const { return low; }
#ifndef NDEBUG
Expand Down

0 comments on commit 62b9764

Please sign in to comment.