MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / nBits

Function nBits

src/memoryprofiler.js:472–479  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

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) {

Callers 1

updateUiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected