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

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 16 Apr 2003 12:53:03 -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	Tue Apr 15 13:50:29 2003
+++ shadow/41297.tmp.8511	Wed Apr 16 12:53:02 2003
@@ -1,12 +1,12 @@
 Bug#: 41297
 Product: Mono/Class Libraries
 Version: unspecified
 OS: unknown
 OS Details: 
-Status: NEEDINFO   
+Status: REOPENED   
 Resolution: 
 Severity: Unknown
 Priority: Minor
 Component: System
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: vi64pa@kolumbus.fi               
@@ -77,6 +77,30 @@
 65
 0
 18295873486192640
 -----------------
 
 Have you checked the expected results with MS runtime?
+
+------- Additional Comments From vi64pa@kolumbus.fi  2003-04-16 12:53 -------
+
+ok, the first example code was buggy, but here is the correct one.
+This is tested with ms.net.
+
+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_ptr2 [i] = 86;
+			else
+				ret_ptr2 [i] = ret_ptr [i];
+		}
+	}
+	Console.WriteLine (d2);
+}