Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
从Ruby中的一个字节获取两个半字节(作为整数)的最简单方法是什么?
如果“字节”是 0 到 255 之间的数字:
n1, n2 = (byte & 0xf0) >> 4, byte & 0x0f