typelevel/spire

Searching API needs better documentation

Aberta

#786 aberto em 3 de abr. de 2019

 (0 comentário) (0 reação) (0 responsável)Scala (238 forks)batch import
good first issue

Métricas do repositório

Stars
 (1.775 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

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.

Guia do colaborador