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