Browse Source

Replace generic log2 with int.

tags/v1.1.6
Andrew Belt 5 years ago
parent
commit
47b79954d2
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      include/math.hpp

+ 2
- 3
include/math.hpp View File

@@ -76,9 +76,8 @@ inline void eucDivMod(int a, int b, int* div, int* mod) {
}

/** Returns `floor(log_2(n))`, or 0 if `n == 1`. */
template <typename T>
T log2(T n) {
T i = 0;
int log2(int n) {
int i = 0;
while (n >>= 1) {
i++;
}


Loading…
Cancel
Save