]> mj.ucw.cz Git - paperjam.git/blobdiff - jam.h
Implemented expand, margins
[paperjam.git] / jam.h
diff --git a/jam.h b/jam.h
index 0c52b3b42db0f574c3088557a8bc358331033d85..31510d8c2b5f3469d3e6ab831919df33b92d231a 100644 (file)
--- a/jam.h
+++ b/jam.h
@@ -7,6 +7,7 @@
 #include <vector>
 #include <list>
 #include <unordered_map>
+#include <cmath>
 
 using namespace std;
 
@@ -16,6 +17,16 @@ typedef unsigned int uint;
 #define UNUSED __attribute__((unused))
 #define FORMAT_CHECK(x,y,z) __attribute__((format(x,y,z)))
 
+static inline bool is_zero(double z)
+{
+  return fabs(z) < 0.001;
+}
+
+static inline bool is_equal(double x, double y)
+{
+  return is_zero(x-y);
+}
+
 #include "pdf-tools.h"
 
 /*** Representation of commands ***/