MCPcopy Create free account
hub / github.com/sql-js/sql.js / unSign

Function unSign

js/sql-debug.js:1334–1340  ·  view source on GitHub ↗
(value, bits, ignore)

Source from the content-addressed store, hash-verified

1332
1333
1334function unSign(value, bits, ignore) {
1335 if (value >= 0) {
1336 return value;
1337 }
1338 return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts
1339 : Math.pow(2, bits) + value;
1340}
1341function reSign(value, bits, ignore) {
1342 if (value <= 0) {
1343 return value;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…