[Mono-bugs] [Bug 60056][Cri] New - long * -int gives bad results (big positive integer)
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Fri, 11 Jun 2004 16:12:06 -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 sebastien@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=60056
--- shadow/60056 2004-06-11 16:12:06.000000000 -0400
+++ shadow/60056.tmp.20070 2004-06-11 16:12:06.000000000 -0400
@@ -0,0 +1,54 @@
+Bug#: 60056
+Product: Mono: Runtime
+Version: unspecified
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Critical
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: sebastien@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: long * -int gives bad results (big positive integer)
+
+Description of Problem:
+Multiplying a long with a negative integer results in a big positive
+integer. There are no (visible) overflow involved.
+
+
+Steps to reproduce the problem:
+1. Compile the following source
+
+using System;
+class T {
+ static void Main () {
+ int seconds = -59;
+ Console.Out.WriteLine ("{0} * {1} == {2}", TimeSpan.TicksPerSecond,
+seconds, (TimeSpan.TicksPerSecond * seconds));
+ }
+}
+
+2. Execute
+
+
+Actual Results (Mono):
+
+10000000 * -59 == 42949672370000000
+
+
+Expected Results:
+
+10000000 * -59 == -590000000
+
+
+How often does this happen?
+Always
+
+
+Additional Information:
+The same binary gives the right result when executed by the MS runtime.