Shared Rust kernels

ported/factorial_common

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

trunc_nonnegative · 6 lines · calc-func/src/ported/factorial_common.rs on GitHub
pub fn trunc_nonnegative(n: f64) -> Result<i64, WorksheetErrorCode> {
    if n < 0.0 {
        return Err(WorksheetErrorCode::Num);
    }
    Ok(n.trunc() as i64)
}

Used by 4 functions.