| 657 | // ------------------------------------------------ |
| 658 | |
| 659 | int Int::GetBitLength() { |
| 660 | |
| 661 | Int t(this); |
| 662 | if(IsNegative()) |
| 663 | t.Neg(); |
| 664 | |
| 665 | int i=NB32BLOCK-1; |
| 666 | while(i>=0 && t.bits[i]==0) i--; |
| 667 | if(i<0) return 0; |
| 668 | return (32-bitLength(t.bits[i])) + i*32; |
| 669 | |
| 670 | } |
| 671 | |
| 672 | // ------------------------------------------------ |
| 673 |
no test coverage detected