2-8

xiaoxiao2021-03-06  48

/ *

Write a function Rightrot (X, N), which returns the right shift to the X cycle (ie the one removed from the rightmost end)

Improve the value obtained after the n binary position

* /

Unsigned Rightrot (unsigned x, unsigned n)

{

Return (~ (~ 0 << n) & x) << (SIZEOF (X) * 8-N) | (x >> n);

}

转载请注明原文地址:https://www.9cbs.com/read-117392.html

New Post(0)