| 72 | } |
| 73 | |
| 74 | inline int |
| 75 | PowOps::tpow(int _x) const { |
| 76 | int m = n; |
| 77 | long long int p = 1; |
| 78 | long long int x = _x; |
| 79 | do { |
| 80 | if (even(m)) { |
| 81 | x *= x; m >>= 1; |
| 82 | } else { |
| 83 | p *= x; m--; |
| 84 | } |
| 85 | if (p > Limits::max) |
| 86 | return Limits::max+1; |
| 87 | if (p < Limits::min) |
| 88 | return Limits::min-1; |
| 89 | } while (m > 0); |
| 90 | return static_cast<int>(p); |
| 91 | } |
| 92 | |
| 93 | forceinline bool |
| 94 | PowOps::powgr(long long int r, int x) const { |
no outgoing calls
no test coverage detected