annotate src/ln.h @ 265:f9169495d476

order log calc
author tobaru
date Sun, 26 Jan 2020 18:20:40 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
265
f9169495d476 order log calc
tobaru
parents:
diff changeset
1 static inline int ln(int sz) {
f9169495d476 order log calc
tobaru
parents:
diff changeset
2 int j = 1 << 6;
f9169495d476 order log calc
tobaru
parents:
diff changeset
3 for (int i = 6; i < 12; i++) {
f9169495d476 order log calc
tobaru
parents:
diff changeset
4 if (sz < j) return i;
f9169495d476 order log calc
tobaru
parents:
diff changeset
5 j <<= 1;
f9169495d476 order log calc
tobaru
parents:
diff changeset
6 }
f9169495d476 order log calc
tobaru
parents:
diff changeset
7 return 12;
f9169495d476 order log calc
tobaru
parents:
diff changeset
8 }
f9169495d476 order log calc
tobaru
parents:
diff changeset
9