From f4170d6bfb763ad0af4002277a37dcd1692534d5 Mon Sep 17 00:00:00 2001 From: Comment Date: Fri, 26 Jul 2013 22:46:17 +0100 Subject: tidy files --- rotord/src/utils.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 rotord/src/utils.cpp (limited to 'rotord/src/utils.cpp') 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 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; +}; -- cgit v1.2.3