[Mono-bugs] [Bug 30729][Maj] New - Incorrect result of bitwise AND operation on long

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
20 Sep 2002 01:05:04 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jtang@tibco.com.

http://bugzilla.ximian.com/show_bug.cgi?id=30729

--- shadow/30729	Thu Sep 19 21:05:04 2002
+++ shadow/30729.tmp.24801	Thu Sep 19 21:05:04 2002
@@ -0,0 +1,46 @@
+Bug#: 30729
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: Mandrake
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jtang@tibco.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Incorrect result of bitwise AND operation on long
+
+Description of Problem:
+The use of bitwise AND operator (&) on values of long does not produce
+correct result.
+
+Steps to reproduce the problem:
+Code example:
+
+using System;
+public class Test {
+    public static void Main() {
+        long rs = 0x0000000080000000L & 0x00000000f0000000L;
+        for (int i=0; i<8; i++, rs >= 8) {
+            Console.Write("{0} ", (byte)rs);
+        }
+        Console.WriteLine();
+    }
+}
+
+Actual Results:
+0 0 0 128 255 255 255 255
+
+Expected Results:
+0 0 0 128 0 0 0 0
+
+How often does this happen? 
+When the 31th bit (of the 0th - 63rd bits) of both operands are "1"
+
+Additional Information: