* Replace autoRef with semantic inclusion for more stable results.
* Move files around to make repository organized better.
This commit is contained in:
parent
400d8f3f38
commit
7c78329244
37 changed files with 1098 additions and 761 deletions
|
@ -1,5 +1,14 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = function maskBit(x, y) {
|
||||
exports.maskBit = function maskBit(x, y) {
|
||||
return x & (1 << y);
|
||||
};
|
||||
|
||||
exports.maskBits = function maskBits(x, y) {
|
||||
return x & y;
|
||||
};
|
||||
|
||||
const pcNibbleLookup = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4];
|
||||
exports.popCountByte = function (x) {
|
||||
return pcNibbleLookup[x & 0x0f] + pcNibbleLookup[(x >>> 4) & 0x0f];
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue