static private GetInt16BinaryString ( |
||
n | The value to get a binary string for. | |
Результат | string |
internal static string GetInt16BinaryString(Int16 n)
{
char[] b = new char[16];
int pos = 15;
int i = 0;
while (i < 16)
{
if ((n & (1 << i)) != 0)
{
b[pos] = '1';
}
else
{
b[pos] = '0';
}
pos--;
i++;
}
return new string(b);
}