binarySearch: Get the position of x in vector y

Description Usage Arguments Value Author(s) Examples

Description

Get the position of x in vector y

Usage

1
binary_search_r(x, y, tol = sqrt(.Machine$double.eps))

Arguments

x

A numeric value

y

A numeric vector

tol

double equal tolerance

Value

A integer of the x position in y.

Author(s)

Wei Zhao

Examples

1
2
3
4
5
binary_search_r(2.5, 1:10)
binary_search_r(1.2, 1:10)
binary_search_r(0.5, 1:10)
binary_search_r(9.5, 1:10)
binary_search_r(11, 1:10)

BruceZhaoR/pjutils documentation built on May 20, 2019, 11:38 a.m.