summaryrefslogtreecommitdiffstats
path: root/src/storage_number.h
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
commit61aedf201c2c4bf0e5aa4db32e74f4d860b88593 (patch)
treebcf4f9a0cd8bc2daf38b2ff9f29bfcc1e5ed8968 /src/storage_number.h
parentNew upstream version 1.8.0+dfsg (diff)
downloadnetdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.tar.xz
netdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.zip
New upstream version 1.9.0+dfsgupstream/1.9.0+dfsg
Diffstat (limited to 'src/storage_number.h')
-rw-r--r--src/storage_number.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/storage_number.h b/src/storage_number.h
index 3c1b6bab3..616ff881e 100644
--- a/src/storage_number.h
+++ b/src/storage_number.h
@@ -17,6 +17,9 @@ typedef long double collected_number;
#define calculated_number_llrint(x) llrintl(x)
#define calculated_number_round(x) roundl(x)
#define calculated_number_fabs(x) fabsl(x)
+#define calculated_number_epsilon (calculated_number)0.0000001
+
+#define calculated_number_equal(a, b) (calculated_number_fabs((a) - (b)) < calculated_number_epsilon)
typedef uint32_t storage_number;
#define STORAGE_NUMBER_FORMAT "%u"