[Mono-bugs] [Bug 75708][Maj] New - Numerical shifting of large integers doesn't work

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Aug 4 07:46:00 EDT 2005


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 mike at wege.net.

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

--- shadow/75708	2005-08-04 07:46:00.000000000 -0400
+++ shadow/75708.tmp.4506	2005-08-04 07:46:00.000000000 -0400
@@ -0,0 +1,124 @@
+Bug#: 75708
+Product: Mono: Compilers
+Version: 1.1
+OS: All
+OS Details: Windows xp/x86, FreeBSD 5.4/x86
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Major
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: mike at wege.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Numerical shifting of large integers doesn't work
+
+Description of Problem:
+
+Numerical shifting of large integers (32 bits or more, signed and unsigned)
+by their full length doesn't yield the expected result of zero.
+
+Steps to reproduce the problem:
+
+-- 
+using System;
+
+namespace Test
+{
+   static class Program
+   {
+      static void Main( string[] args )
+      {
+         sbyte  s8  = 1;
+         byte   u8  = 1;
+         short  s16 = 1;
+         ushort u16 = 1;
+         int    s32 = 1;
+         uint   u32 = 1;
+         long   s64 = 1;
+         ulong  u64 = 1;
+
+         Console.WriteLine( "s8: {0}", s8 );
+         Console.WriteLine( "u8: {0}", u8 );
+         Console.WriteLine( "s16: {0}", s16 );
+         Console.WriteLine( "u16: {0}", u16 );
+         Console.WriteLine( "s32: {0}", s32 );
+         Console.WriteLine( "u32: {0}", u32 );
+         Console.WriteLine( "s64: {0}", s64 );
+         Console.WriteLine( "u64: {0}", u64 );
+
+         s8 <<= 8;
+         u8 <<= 8;
+         s16 <<= 16;
+         u16 <<= 16;
+         s32 <<= 32;
+         u32 <<= 32;
+         s64 <<= 64;
+         u64 <<= 64;
+
+         Console.WriteLine();
+         Console.WriteLine( "s8: {0}", s8 );
+         Console.WriteLine( "u8: {0}", u8 );
+         Console.WriteLine( "s16: {0}", s16 );
+         Console.WriteLine( "u16: {0}", u16 );
+         Console.WriteLine( "s32: {0}", s32 );
+         Console.WriteLine( "u32: {0}", u32 );
+         Console.WriteLine( "s64: {0}", s64 );
+         Console.WriteLine( "u64: {0}", u64 );
+      }
+   }
+}
+-- 
+
+Actual Results:
+
+-- 
+s8: 1
+u8: 1
+s16: 1
+u16: 1
+s32: 1
+u32: 1
+s64: 1
+u64: 1
+
+s8: 0
+u8: 0
+s16: 0
+u16: 0
+s32: 1
+u32: 1
+s64: 1
+u64: 1
+-- 
+
+Expected Results:
+
+s8: 1
+u8: 1
+s16: 1
+u16: 1
+s32: 1
+u32: 1
+s64: 1
+u64: 1
+
+s8: 0
+u8: 0
+s16: 0
+u16: 0
+s32: 0
+u32: 0
+s64: 0
+u64: 0
+
+How often does this happen? 
+
+Always. Using mcs or gmcs doesn't make a difference.
+
+Additional Information:
+
+Couldn't find the "Create a new attachment" link - sorry.


More information about the mono-bugs mailing list