C# vs VB.NET bitwise OR
c#, vb.net
Solution
In VB.NET, `&H80000000` has type `Int32` and is a negative number. In C#, `0x80000000` has type `UInt32` and is a positive number. The difference between languages is not in bitwise OR, but in integer literals.
Most likely, the reason why the types are different is because C# evolved from a language that supported unsigned types, and VB.NET evolved from a language that did not. In a language without unsigned types, it made sense for `&H80000000` to be a negative integer.
Problem
Why does the OR operator in vb and C# give different results. ``` Console.WriteLine(0x2 | 0x80000000); output 2147483650 ``` http://dotnetfiddle.net/wC9AgG ``` Console.WriteLine(&H2 Or &H80000000) output -2147483646 ``` http://dotnetfiddle.net/g4tLQ9