+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+#ifndef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
+#ifndef ABS
+#define ABS(a) ((a) < 0 ? -(a) : (a))
+#endif
+
+#ifndef SIGN
+#define SIGN(a) ((a) < 0 ? -1 : ((a)>0 ? 1 : 0))
+#endif
+
+#define SIZEOF_ARRAY(array, type) (sizeof(array) / sizeof(type))
+#define SIZEOF_ARRAY_INT(array) SIZEOF_ARRAY(array, int)
+