typelevel/spire

Searching API needs better documentation

Open

#786 opened on Apr 3, 2019

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Scala (1,775 stars) (238 forks)batch import
good first issue

Description

We state

  /** Performs a binary search, returns an index using the same convention as java.util.Arrays.binarySearch. */
final def search[@sp A: Order](as: Array[A], item: A, lower: Int, upper: Int): Int = {

However, our convention is to search the interval [lower, upper] inclusive, whereas java.util.Arrays.binarySearch excludes the upper bound.

Contributor guide

Searching API needs better documentation · typelevel/spire#786 | Good First Issue