equal
deleted
inserted
replaced
888 while (p != 0 && p <= (julong)x) { |
888 while (p != 0 && p <= (julong)x) { |
889 // p = 2^(i+1) && p <= x (i.e., 2^(i+1) <= x) |
889 // p = 2^(i+1) && p <= x (i.e., 2^(i+1) <= x) |
890 i++; p *= 2; |
890 i++; p *= 2; |
891 } |
891 } |
892 // p = 2^(i+1) && x < p (i.e., 2^i <= x < 2^(i+1)) |
892 // p = 2^(i+1) && x < p (i.e., 2^i <= x < 2^(i+1)) |
893 // (if p = 0 then overflow occured and i = 31) |
893 // (if p = 0 then overflow occured and i = 63) |
894 return i; |
894 return i; |
895 } |
895 } |
896 |
896 |
897 //* the argument must be exactly a power of 2 |
897 //* the argument must be exactly a power of 2 |
898 inline int exact_log2(intptr_t x) { |
898 inline int exact_log2(intptr_t x) { |