I have two UInt16 values
private UInt16 leastSignificantWord;
private UInt16 mostSignificantWord;
The two words (UInt16 values) come from a component which divides a UInt32 status / error value into two words and returns the two words. Now i need get back to the UInt32 value. To sum the two words together wouldn't do the trick because of disregard if the most and least significant.
For example:
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;
Is there a way to solve this? To be honest i have never worked with bits / bytes in c# so i had never faced such a problem. Thanks in advance