[Mono-bugs] [Bug 45036][Wis] New - Array.BinarySearch starts at incorrect location.
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Tue, 17 Jun 2003 23:45: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 tum@veridicus.com.
http://bugzilla.ximian.com/show_bug.cgi?id=45036
--- shadow/45036 Tue Jun 17 23:45:06 2003
+++ shadow/45036.tmp.28416 Tue Jun 17 23:45:06 2003
@@ -0,0 +1,46 @@
+Bug#: 45036
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: tum@veridicus.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Array.BinarySearch starts at incorrect location.
+
+Please fill in this template when reporting a bug, unless you know what
+you are doing.
+Description of Problem:
+
+Array.BinarySearch starts at the wrong location. It should start at
+((index + count) - 1) / 2 instead of ((index + count) / 2).
+
+Steps to reproduce the problem:
+
+for (int i = 0; i < 100; i++)
+{
+ arrayList.Add(1);
+}
+
+Console.WriteLine(arrayList.BinarySearch(1));
+
+Actual Results:
+
+50
+
+Expected Results:
+
+49
+
+Additional Information:
+
+This is required by the ECMA specs and is the behaviour of MS.NET. Some
+rotor tests fail because of this.