| 114 | // Computes x^n. |
| 115 | template <typename T> |
| 116 | T PowUint(T x, uint64_t n) |
| 117 | { |
| 118 | T res = 1; |
| 119 | for (T t = x; n > 0; n >>= 1, t *= t) |
| 120 | if (n & 1) |
| 121 | res *= t; |
| 122 | return res; |
| 123 | } |
| 124 | |
| 125 | template <typename T> |
| 126 | T Pow2(T x) |
no outgoing calls