Skip to content
Subhajit Sahu edited this page Jan 24, 2021 · 7 revisions

Get a bit. 📰 📘

Alternatives: get, getAs.
Similar: get, set, toggle.


Bit.get(x, i);
// x: an int or long
// i: bit index
import io.github.javaf.*;

Bit.get(6, 0);
// 0 (110,0 ⇒ 0)

Bit.get(6, 1);
// 1 (110,1 ⇒ 1)

Bit.get(6, 2);
// 1 (110,2 ⇒ 1)


References

Clone this wiki locally