-
Notifications
You must be signed in to change notification settings - Fork 1
rotate
Subhajit Sahu edited this page Jul 25, 2022
·
12 revisions
Rotate bits by a certain amount.
rotate(x, [n])
// x: an int32
// n: rotate amount (+ve: left, -ve: right)
const xbit = require('extra-bit');
xbit.rotate(0x11112222, 4);
// → 286401057 (0x11122221)
xbit.rotate(0x11112222, -4);
// → 554766882 (0x21111222)