Skip to main content

rectangle_rule

Function rectangle_rule 

Source
pub fn rectangle_rule<F>(f: F, a: f64, b: f64, n: usize) -> Option<f64>
where F: Fn(f64) -> f64,
Expand description

Approximates an integral with the left-rectangle rule.

Returns None when n == 0, when the bounds are not finite, or when a sampled function value is not finite. Reversed bounds return the negative integral.