// Locate the first element greater than or equal to a key in an ascending numeric vector. Returns the length when insertion belongs at the end. pub fn lower_bound_pos(items: vector, key: f64) -> i64 { let mut lo = 0; let mut hi = len(items); while lo