-
Notifications
You must be signed in to change notification settings - Fork 1
parity
Subhajit Sahu edited this page Jun 6, 2020
·
13 revisions
Similar: [count], parity.
bit.parity(x, [n]);
// x: an int32
// n: number of bits (1)
const bit = require('extra-bit');
bit.parity(7);
// 1 (1,1,1 => 1)
bit.parity(5);
// 0 (1,0,1 => 0)
bit.parity(8, 2);
// 2 (10,00 => 10)
bit.parity(63, 4);
// 12 (11,1111 => 1100)