語言

Integer.HighestOneBit(Int32) 方法

定義

回傳 int 一個最多一個位元的值,位於指定 int 值中最高階(「最左」)一位元的位置。

[Android.Runtime.Register("highestOneBit", "(I)I", "")]
public static int HighestOneBit(int i);
[<Android.Runtime.Register("highestOneBit", "(I)I", "")>]
static member HighestOneBit : int -> int

參數

i
Int32

計算出最高位元的值

傳回

一個 int 只有一個位元的值,位於指定值中最高階一位元的位置;若該值本身等於零,則為零。

屬性

備註

回傳 int 一個最多一個位元的值,位於指定 int 值中最高階(「最左」)一位元的位置。 若指定的值在其補數二進位表示中沒有一位元,也就是說,該值等於零,則回傳為零。

已在1.5中新增。

Java 文件 java.lang.Integer.highestOneBit(int)。

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

適用於