[Mono-bugs] [Bug 38674][Nor] Changed - TimeSpan.MinValue.Negate () does not throw
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Thu, 24 Jul 2003 12:15:54 -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 gonzalo@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=38674
--- shadow/38674 Thu Jul 24 11:19:53 2003
+++ shadow/38674.tmp.13951 Thu Jul 24 12:15:54 2003
@@ -71,6 +71,32 @@
------- Additional Comments From gonzalo@ximian.com 2003-04-01 22:13 -------
You should undo Nick's workaround in TimeSpan.Negate, which is already
in CVS.
------- Additional Comments From miguel@ximian.com 2003-07-24 11:19 -------
Can we get a simple test case for this bug?
+
+------- Additional Comments From gonzalo@ximian.com 2003-07-24 12:15 -------
+Here it is:
+---------------
+using System;
+
+class Test
+{
+ static void Main ()
+ {
+ long l = long.MinValue;
+ long k;
+ checked {
+ k = -l;
+ }
+ Console.WriteLine (l);
+ Console.WriteLine (k);
+ }
+}
+----------
+
+Under MS runtime, it throws an OverflowException.
+Under mono runtime, it prints:
+-9223372036854775808
+-9223372036854775808
+