There was an error while loading. Please reload this page.
Get index of first set bit from LSB. 📰 📘
Alternatives: scan, scanReverse.
Bit.scan(x); // x: an int or long
import io.github.javaf.*; Bit.scan(7); // 0 (111 ⇒ 0) Bit.scan(12); // 2 (1100 ⇒ 2) Bit.scan(64); // 6 (1000000 ⇒ 6)