summaryrefslogtreecommitdiff
path: root/rotord/src/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/utils.cpp')
-rw-r--r--rotord/src/utils.cpp29
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;
+};