Skip to main content

rectangle_rule

Function rectangle_rule 

Source
pub fn rectangle_rule<F>(
    integrand: F,
    lower_bound: f64,
    upper_bound: f64,
    subinterval_count: 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.