語言

Integer.RotateRight(Int32, Int32) 方法

定義

回傳將指定值的補數二進位 int 表示旋轉至指定位元數後得到的值。

[Android.Runtime.Register("rotateRight", "(II)I", "")]
public static int RotateRight(int i, int distance);
[<Android.Runtime.Register("rotateRight", "(II)I", "")>]
static member RotateRight : int * int -> int

參數

i
Int32

該值的位元要向右旋轉

distance
Int32

需要向右旋轉的位數

傳回

將指定 int 值的補數二進位表示旋轉至指定位元數所獲得的值。

屬性

備註

回傳將指定值的補數二進位 int 表示旋轉至指定位元數後得到的值。 (右手移位位元,或低階側重入,左邊或高階位。)

注意,右旋轉距離為負等價於左旋轉: rotateRight(val, -distance) == rotateLeft(val, distance)。 另外請注意,旋轉 32 的任意倍數都是 no-op,因此旋轉距離中除了最後五個位元外,其他都可以忽略,即使距離為負: rotateRight(val, distance) == rotateRight(val, distance & 0x1F)

已在1.5中新增。

Java 文件 java.lang.Integer.rotateRight(int, int)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於