Skip to content

Commit

Permalink
add epsilon def to header file
Browse files Browse the repository at this point in the history
  • Loading branch information
etotheipluspi committed Sep 17, 2024
1 parent 62da78f commit e508c9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/math/FGTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,7 @@ double FGTable::GetValue(double key) const
double Span = Data[2*r] - x0;
assert(Span > 0.0);
double Factor = (key - x0) / Span;
const double epsilon = 1e-9;
assert(Factor >= -epsilon && Factor <= 1.0 + epsilon);
assert(Factor >= -EPSILON && Factor <= 1.0 + EPSILON);


double y0 = Data[2*r-1];
Expand Down
2 changes: 2 additions & 0 deletions src/math/FGTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ class JSBSIM_API FGTable : public FGParameter, public FGJSBBase

std::string GetName(void) const {return Name;}

static constexpr double EPSILON = 1e-9;

private:
enum type {tt1D, tt2D, tt3D} Type;
enum axis {eRow=0, eColumn, eTable};
Expand Down

0 comments on commit e508c9a

Please sign in to comment.