summaryrefslogtreecommitdiff
path: root/src/misc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc.cc')
-rw-r--r--src/misc.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/misc.cc b/src/misc.cc
new file mode 100644
index 0000000000..54746fd836
--- /dev/null
+++ b/src/misc.cc
@@ -0,0 +1,14 @@
+#include "misc.hh"
+#include "glob.hh"
+
+#include <math.h>
+
+int intlog2(int d) {
+ int i=0;
+ while (!(d&1)) {
+ d/= 2; i++;
+ }
+ assert(!(d/2));
+ return i;
+}
+