(n)
| 470 | |
| 471 | // Naive function to compute how many bits will be needed to represent the number 'n' in binary. This will be our pointer 'word width' in the UI. |
| 472 | function nBits(n) { |
| 473 | var i = 0; |
| 474 | while (n >= 1) { |
| 475 | ++i; |
| 476 | n /= 2; |
| 477 | } |
| 478 | return i; |
| 479 | } |
| 480 | |
| 481 | // Returns i formatted to string as fixed-width hexadecimal. |
| 482 | function toHex(i, width) { |