diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-05-14 12:15:14 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-05-14 12:15:14 +0100 |
| commit | af4dca452a95a5b43ac0395f9505ade583aacf2f (patch) | |
| tree | 2f30b0baa498cb6e22b90ec4c31c6056b26c9b45 /rotord/utils.cpp | |
| parent | f780d225c3a91dfb3a480bb734446858321002a0 (diff) | |
comparison and arithmetic
Diffstat (limited to 'rotord/utils.cpp')
| -rw-r--r-- | rotord/utils.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/rotord/utils.cpp b/rotord/utils.cpp index 9e8beb6..9828124 100644 --- a/rotord/utils.cpp +++ b/rotord/utils.cpp @@ -4,21 +4,26 @@ using namespace std; //float equality bool fequal(const float u,const float v){ - if (abs(u-v)<.001) return true; + if (abs(u-v)<FLOAT_THRESHOLD) return true; else return false; }; -bool flessorequal(const float u,const float v){ +bool fless_or_equal(const float u,const float v){ //v is less or equal to u - if (u-v>-.001) return true; + if (u-v>-FLOAT_THRESHOLD) return true; else return false; }; -bool fmoreorequal(const float u,const float v){ +bool fgreater_or_equal(const float u,const float v){ //v is more or equal to u - if (v-u>-.001) return true; + if (v-u>-FLOAT_THRESHOLD) return true; else return false; }; bool fless(const float u,const float v){ - //v is less or equal to u - if (u-v>.001) return true; + //v is less than u + if (u-v>FLOAT_THRESHOLD) return true; + else return false; +}; +bool fgreater(const float u,const float v){ + //v is greater than u + if (v-u>FLOAT_THRESHOLD) return true; else return false; }; |
