Function peroxide::util::non_macro::seq_with_precision

source ·
pub fn seq_with_precision<S, T, U>(
    start: S,
    end: T,
    step: U,
    precision: usize,
) -> Vec<f64>
where S: Into<f64> + Copy, T: Into<f64> + Copy, U: Into<f64> + Copy,
Expand description

Seq with Precision

§Example

use peroxide::fuga::*;

let x = seq(0, 1e-2, 1e-3);
assert_ne!(x[9], 0.009);

let x = seq_with_precision(0, 1e-2, 1e-3, 3);
assert_eq!(x[9], 0.009);