-
Notifications
You must be signed in to change notification settings - Fork 0
parity
Subhajit Sahu edited this page Jan 24, 2021
·
7 revisions
Bit.parity(x, [n]);
// x: an int or long
// n: number of bits (1)
import io.github.javaf.*;
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)