* Gets the number of bits needed to represent the absolute value of this UInt64 * @this {!UInt64} * @returns {number} Number of represented bits
()
| 1301 | * @returns {number} Number of represented bits |
| 1302 | */ |
| 1303 | get NumBits () { |
| 1304 | if (this.isNegative) { |
| 1305 | return this.eq(UINT64_MIN) ? 64 : this.neg().NumBits |
| 1306 | } |
| 1307 | |
| 1308 | let val = (this.high !== 0) ? this.high : this.low |
| 1309 | |
| 1310 | let bit |
| 1311 | for (bit = 31; bit > 0; bit--) { |
| 1312 | if ((val & (1 << bit)) !== 0) { |
| 1313 | break |
| 1314 | } |
| 1315 | } |
| 1316 | |
| 1317 | return (this.high !== 0) ? (bit + 33) : (bit + 1) |
| 1318 | } |
| 1319 | |
| 1320 | /** |
| 1321 | * Is this value zero? |