Short.ToUnsignedInt(Int16) Method

Definition

Converts the argument to an int by an unsigned conversion.

[Android.Runtime.Register("toUnsignedInt", "(S)I", "", ApiSince=26)]
public static int ToUnsignedInt (short x);
[<Android.Runtime.Register("toUnsignedInt", "(S)I", "", ApiSince=26)>]
static member ToUnsignedInt : int16 -> int

Parameters

x
Int16

the value to convert to an unsigned int

Returns

the argument converted to int by an unsigned conversion

Attributes

Remarks

Converts the argument to an int by an unsigned conversion. In an unsigned conversion to an int, the high-order 16 bits of the int are zero and the low-order 16 bits are equal to the bits of the short argument.

Consequently, zero and positive short values are mapped to a numerically equal int value and negative short values are mapped to an int value equal to the input plus 2<sup>16</sup>.

Added in 1.8.

Java documentation for java.lang.Short.toUnsignedInt(short).

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