Function linspace

Source
pub fn linspace<T>(
    dst: &mut [T],
    first_value: T,
    last_value: T,
    endpoint: EndPoint,
)
where T: Copy + Add<T, Output = T> + Sub<T, Output = T> + Mul<T, Output = T> + Div<T, Output = T> + FromUsize,
Expand description

Computes a linear sequence of uniformly spaced values, starting with first_value and ending either at or just before last_value, depending on endpoint. Results are written to dst, whose length is used to determine the step size between values.

This method works for most integer and floating point values. For integers, standard truncating division is used, so fractional values will be rounded towards zero.