We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Get index of first set bit from MSB. 📰 📘
Alternatives: scan, scanReverse.
Bit.scanReverse(x); // x: an int or long
import io.github.javaf.*; Bit.scanReverse(13); // 13 (1101 ⇒ 3) Bit.scanReverse(5); // 2 (101 ⇒ 2) Bit.scanReverse(1); // 0 (1 ⇒ 0)