-
Notifications
You must be signed in to change notification settings - Fork 0
toggle
Subhajit Sahu edited this page Jan 24, 2021
·
7 revisions
Bit.toggle(x, i);
// x: an int or long
// i: bit index
import io.github.javaf.*;
Bit.toggle(6, 0);
// 7 (110,0 ⇒ 111)
Bit.toggle(6, 1);
// 4 (110,1 ⇒ 100)
Bit.toggle(6, 2);
// 2 (110,2 ⇒ 010)