summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 14772c0)
raw | patch | inline | side by side (parent: 14772c0)
author | alex <alex@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 23 Jun 2002 22:28:06 +0000 (22:28 +0000) | ||
committer | alex <alex@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 23 Jun 2002 22:28:06 +0000 (22:28 +0000) |
program/src/rrd_format.h | patch | blob | history | |
program/src/rrd_nan_inf.c | [new file with mode: 0644] | patch | blob |
program/src/rrd_nan_inf.h | [new file with mode: 0644] | patch | blob |
index da0f1ba46c54329b78ab27a33c6a9608b0249403..b9fa2c266b8cef8d800c60ff3b163650c75dbc48 100644 (file)
--- a/program/src/rrd_format.h
+++ b/program/src/rrd_format.h
#define RRD_VERSION "0002"
#define FLOAT_COOKIE 8.642135E130
-#if defined(WIN32)
-#define DNAN ((double)fmod(0.0,0.0))
-#define DINF ((double)log(0.0))
-#else
-
-#define DNAN ((double)(0.0/0.0)) /* we use a DNAN to
- * represent the UNKNOWN
- * */
-#define DINF ((double)(1.0/0.0)) /* we use a DINF to
- * represent a value at the upper or
- * lower border of the graph ...
- * */
-#endif
+#include "rrd_nan_inf.h"
typedef union unival {
unsigned long u_cnt;
diff --git a/program/src/rrd_nan_inf.c b/program/src/rrd_nan_inf.c
--- /dev/null
@@ -0,0 +1,13 @@
+#include "rrd_nan_inf.h"
+
+#if defined(WIN32)
+
+double set_to_DNAN(void) { return (double)fmod(0.0,0.0); }
+double set_to_DINF(void) { return (double)log(0.0); }
+
+#else
+
+double set_to_DNAN(void) { return (double)(0.0/0.0); }
+double set_to_DINF(void) { return (double)(1.0/0.0); }
+
+#endif
diff --git a/program/src/rrd_nan_inf.h b/program/src/rrd_nan_inf.h
--- /dev/null
@@ -0,0 +1,5 @@
+#define DNAN set_to_DNAN()
+#define DINF set_to_DINF()
+
+double set_to_DNAN(void);
+double set_to_DINF(void);