[Mono-bugs] [Bug 41297][Min] New - unsafe decimal looses its sign

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sun, 13 Apr 2003 12:57:36 -0400 (EDT)


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 vi64pa@kolumbus.fi.

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

--- shadow/41297	Sun Apr 13 12:57:36 2003
+++ shadow/41297.tmp.12243	Sun Apr 13 12:57:36 2003
@@ -0,0 +1,57 @@
+Bug#: 41297
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vi64pa@kolumbus.fi               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: unsafe decimal looses its sign
+
+Description of Problem:
+
+If you run the followin code with mcs/mono
+
+public static void Main () 
+{
+ 
+	decimal d = -18295873486192640;
+	decimal d2;
+	unsafe {
+		byte* ret_ptr = (byte *)&d;
+		byte* ret_ptr2 = (byte *)&d2;
+		for (int i = 0; i < 16; i++) {
+			Console.WriteLine (ret_ptr [i]);
+			if (ret_ptr [i] == 128) 
+				ret_ptr [i] = 86;
+			else
+				ret_ptr2 [i] = ret_ptr [i];
+		}
+	}
+	Console.WriteLine (d2);
+}
+
+
+it prints:
+
+18295873486192640
+
+So, there are no (negative) sign. With ms.net there is.
+
+
+Actual Results:
+18295873486192640
+
+Expected Results:
+-18295873486192640
+
+How often does this happen? 
+allways