Is there a way to perform a circular bit shift in C#?

后端 未结 6 959
太阳男子
太阳男子 2020-11-29 04:58

I know that the following is true

int i = 17; //binary 10001
int j = i << 1; //decimal 34, binary 100010

But, if you shift too far, t

6条回答
  •  情歌与酒
    2020-11-29 05:35

    I have to admit, I just did a search for "C# bit rotate" and found a link to a page with a Java class that would be easily adapted to C#

    I also found this in Google Book which is a C++ function with similar behavior

提交回复
热议问题