! power this = this ^ pow this can be negative pow is >= 0 */
| 574 | pow is >= 0 |
| 575 | */ |
| 576 | uint Pow2(const Int<value_size> & pow) |
| 577 | { |
| 578 | bool was_sign = IsSign(); |
| 579 | uint c = 0; |
| 580 | |
| 581 | if( was_sign ) |
| 582 | c += Abs(); |
| 583 | |
| 584 | uint c_temp = UInt<value_size>::Pow(pow); |
| 585 | if( c_temp > 0 ) |
| 586 | return c_temp; // c_temp can be: 0, 1 or 2 |
| 587 | |
| 588 | if( was_sign && (pow.table[0] & 1) == 1 ) |
| 589 | // negative value to the power of odd number is negative |
| 590 | c += ChangeSign(); |
| 591 | |
| 592 | return (c==0)? 0 : 1; |
| 593 | } |
| 594 | |
| 595 | |
| 596 | public: |