diff options
| author | Comment <tim@gray.(none)> | 2013-07-26 22:46:17 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-07-26 22:46:17 +0100 |
| commit | f4170d6bfb763ad0af4002277a37dcd1692534d5 (patch) | |
| tree | db32d9753de780063e3afeb64764e13e5c4f5087 /rotord/src/utils.cpp | |
| parent | 3d7eea02aa7a155b84c8c74ecbfd55a1941a9297 (diff) | |
tidy files
Diffstat (limited to 'rotord/src/utils.cpp')
| -rw-r--r-- | rotord/src/utils.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/rotord/src/utils.cpp b/rotord/src/utils.cpp new file mode 100644 index 0000000..9828124 --- /dev/null +++ b/rotord/src/utils.cpp @@ -0,0 +1,29 @@ +#include "utils.h" + +using namespace std; + +//float equality +bool fequal(const float u,const float v){ + if (abs(u-v)<FLOAT_THRESHOLD) return true; + else return false; +}; +bool fless_or_equal(const float u,const float v){ + //v is less or equal to u + if (u-v>-FLOAT_THRESHOLD) return true; + else return false; +}; +bool fgreater_or_equal(const float u,const float v){ + //v is more or equal to u + if (v-u>-FLOAT_THRESHOLD) return true; + else return false; +}; +bool fless(const float u,const float v){ + //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; +}; |
