bitReverse

bitReverse

> Functions

Returns the number obtained by reversing the order of the 64 bits of the integer x: the least significant bit (position 0) becomes the most significant bit (position 63), and so on. The original number is not modified.

The reversal always covers all 64 bits, including leading zeros: bitReverse(12) (1100 in binary) moves those four bits to the top of the integer and returns 3458764513820540928, that is 0011 followed by 60 zeros. Since bit 0 lands in position 63, the sign bit, the result is negative whenever x is odd.

Parameters
Return
Note