summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/common.c b/common.c
index d457a6a..17b594b 100644
--- a/common.c
+++ b/common.c
@@ -80,7 +80,7 @@ MsTime msNow()
}
//***************************************************************************
-//
+// Misc. Functions
//***************************************************************************
int minMax(int x, int min, int max)
@@ -94,3 +94,18 @@ int minMax(int x, int min, int max)
return x;
}
+double min(double a, double b)
+{
+ return a < b ? a : b;
+}
+
+double max(double a, double b)
+{
+ return a >= b ? a : b;
+}
+
+int getrand(int min, int max)
+{
+ srand(time(0));
+ return rand() % (max-min) + min;
+}