我需要对 16 位整数(ushort / UInt16)执行按位左移,但 C# 中的按位运算符似乎仅适用于 int (32 位)。如何在 ushort 上使用
移位后将结果值转换回 ushort:
ushort value = 1; ushort shifted = (ushort)(value << 2);