typelevel/spire

Searching API needs better documentation

Open

#786 ouverte le 3 avr. 2019

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)Scala (238 forks)batch import
good first issue

Métriques du dépôt

Stars
 (1 775 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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.

Guide contributeur