blob: 982812494ad892d742ad2fd20f3e4f7eab5b2694 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;
};
|