Shared Rust kernels

catalogue/rounding_more

All modules · quoted at commit 9e1884369a67 of DnaCalc/DnaCalc. Comments are the source's own.

two · 9 lines · calc-func/src/catalogue/rounding_more.rs on GitHub
fn two(
    site: &Site<'_>,
    a: &[CalcValue],
    kernel: fn(f64, f64) -> Result<f64, WorksheetErrorCode>,
) -> Step<CalcValue> {
    let x = num(site, a, 0)?;
    let significance = opt(site, a, 1, 1.0)?;
    out(site, kernel(x, significance))
}

Used by 3 functions.

three · 10 lines · calc-func/src/catalogue/rounding_more.rs on GitHub
fn three(
    site: &Site<'_>,
    a: &[CalcValue],
    kernel: fn(f64, f64, f64) -> Result<f64, WorksheetErrorCode>,
) -> Step<CalcValue> {
    let x = num(site, a, 0)?;
    let significance = opt(site, a, 1, 1.0)?;
    let mode = opt(site, a, 2, 0.0)?;
    out(site, kernel(x, significance, mode))
}

Used by 2 functions.