dotnet / dotnet/dotnet-api-docs

What if a binary search is going to be performed in an empty array?

Open
#1,480 0 comments 0 reactions 0 assignees View on GitHub
area-System.Runtime dotnet-api/prod Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

The function returns `-1`. Shouldn't it be specifically mentioned? It is quite important in my opinion.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 23a54b61-3aff-2dfd-9520-190191a516e4
* Version Independent ID: b3e84250-d3e4-8716-f4a5-659ee75f5f77
* Content: [Array.BinarySearch Method (System)](https://docs.microsoft.com/en-us/dotnet/api/system.array.binarysearch?view=netframework-4.7.2#System_Array_BinarySearch_System_Array_System_Int32_System_Int32_System_Object_System_Collections_IComparer_)
* Content Source: [xml/System/Array.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System/Array.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.