I’m in the process of porting some ANSI C++ code to C#… and this is killing me right now.
Both tests have value = 6844268.
Test code:
value >> 12 value & 0x00000FFF
C++ returns 18273 and 29497, whereas C# returns 1670 and 3948. I’ve tried every possible combination of types in C# (int, uint, long, ulong, Int64…), but no go 🙁
Original value in C++ is unsigned int. Anyone have any ideas?
EDIT: Argh, I messed up my debugging. Was looking at array[value] instead of value. My bad.
Check your C++ definitions for overridden
>>operator code perhaps?C# is calculating the right values, are you absolutely 100% sure your values are what you say they are?
Just to go through the motions:
they don’t line up, there must be some details you’re not seeing in your code there.