Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Microsoft

Journal mirko's Journal: Interesting C#2.0 shifting bug

I have been advised to consult the following bug report which was submitted to the MSDN. A very fundamental bug occurs when you compile Console.WriteLine( ((int)-1) >> 1);. You'd expect a logical right shift to occur and the value -1 (0xFFFFFFFF) to be returned but you receive 2147483647 (0x1FFFFFFF) instead. Note that the bug has since been fixed and should not appear in the next MSDN release of Visual Studio. This information could be quite valuable to many developers, even though this bug does not occur in Mono !
This discussion has been archived. No new comments can be posted.

Interesting C#2.0 shifting bug

Comments Filter:

A morsel of genuine history is a thing so rare as to be always valuable. -- Thomas Jefferson

Working...