我有兩個UINT16值轉換2個UINT16值到一個UInt32的值考慮至少和最顯著字
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#中的位/字節工作,所以我從來沒有遇到過這樣的問題。在此先感謝