Udostępnij za pośrednictwem


Integer.HighestOneBit(Int32) Method

Definition

Returns an int value with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specified int value.

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

Parameters

i
Int32

the value whose highest one bit is to be computed

Returns

an int value with a single one-bit, in the position of the highest-order one-bit in the specified value, or zero if the specified value is itself equal to zero.

Attributes

Remarks

Returns an int value with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specified int value. Returns zero if the specified value has no one-bits in its two's complement binary representation, that is, if it is equal to zero.

Added in 1.5.

Java documentation for java.lang.Integer.highestOneBit(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to