diff src/ln.h @ 265:f9169495d476

order log calc
author tobaru
date Sun, 26 Jan 2020 18:20:40 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ln.h	Sun Jan 26 18:20:40 2020 +0900
@@ -0,0 +1,9 @@
+static inline int ln(int sz) {
+    int j = 1 << 6;
+    for (int i = 6; i < 12; i++) {
+        if (sz < j) return i;
+        j <<= 1;
+    }
+    return 12;
+} 
+