Skip to main content

table

Function table 

Source
pub fn table(x: f64, points: &[(f64, f64)]) -> f64
Expand description

Linear interpolation through a set of (x, y) points (sorted by x, not necessarily evenly spaced) — a table(x, a, b, c, d, ...)-style lookup. Clamped (not extrapolated) outside the given range, holding the nearest endpoint’s y. points must have at least one entry and be sorted ascending by x (the caller’s responsibility — a device-file-level parser is the natural place to sort once at load time, not every step).