summaryrefslogtreecommitdiff
path: root/calc.h
diff options
context:
space:
mode:
Diffstat (limited to 'calc.h')
-rw-r--r--calc.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/calc.h b/calc.h
new file mode 100644
index 0000000..44e8ec8
--- /dev/null
+++ b/calc.h
@@ -0,0 +1,21 @@
+#ifndef _CALC_H_
+#define _CALC_H_
+
+#define Abs(x) ((x < 0)? -x : x)
+#define degtorad(x) (x * 0.0174532925)
+#define sgn(x) ((int)((x > 0) ? 1 : (x == 0)?0:-1))
+
+#define GetBit(x, y) (x & (1 << y)) != 0
+#define SetBit(x, y) (x |= (1 << y))
+#define ClearBit(x, y) (x &= ~(1 << y))
+
+#define crand() random()
+
+void seedrandom(void);
+unsigned int random(void);
+void table(void);
+void fill(unsigned int *, unsigned int, unsigned int);
+
+extern int TDist[64];
+
+#endif