-
Notifications
You must be signed in to change notification settings - Fork 0
setAs
Subhajit Sahu edited this page Jan 24, 2021
·
7 revisions
Bit.setAs(x, m, [f]);
// x: an int or long
// m: bit mask
// f: bit value (1)
import io.github.javaf.*;
Bit.setAs(8, 2, 1);
// 10 (0x8 set 0x2 ⇒ 0xA)
Bit.setAs(15, 3, 0);
// 12 (0xF clear 0x3 ⇒ 0xC)
Bit.setAs(0x1234, 0x430, 1);
// 5684 (0x1234 set 0x430 ⇒ 0x1634)