我有两个 UInt16 值
private UInt16 leastSignificantWord;
private UInt16 mostSignificantWord;
这两个字(UInt16 值)来自一个组件,该组件将 UInt32 状态/错误值分成两个字并返回这两个字。现在我需要回到 UInt32 值。将这两个词加在一起是行不通的,因为忽略了最重要和最不重要的。
例如:
private UInt16 leastSignificantWord = 1;
private UInt16 mostSignificantWord = 1;
//result contains the value 2 after sum both words
//which can not be correct because we have to take note of the most and least significant
UInt32 result = leastSignificantWord + mostSignificantWord;
有没有办法解决这个问题?老实说,我从来没有在 c# 中使用过位/字节,所以我从来没有遇到过这样的问题。提前致谢