Skip to content

reverse

Subhajit Sahu edited this page Jan 17, 2021 · 6 revisions

Reverse all bits. 📰 📘

Similar: rotate, reverse.


Bit.reverse(x);
// x: an int or long
import io.github.javaf.*;

Bit.reverse(0xFFFF0000);
// 65535 (0x0000FFFF)

Bit.reverse(0x00AABBCC);
// 870143232 (0x33DD5500)

Bit.reverse(0x1234);
// 742916096 (0x2C480000)


References

Clone this wiki locally