Skip to main content

nearest

Function nearest 

Source
pub fn nearest(x: &[f64], at: f64) -> Option<usize>
Expand description

The index of the sample nearest at, when there is one.

x must be sorted ascending. A query outside the sampled span answers the end nearest it.