Skip to main content

ratio

Function ratio 

Source
pub fn ratio(part: usize, whole: usize) -> f64
Expand description

One count’s share of another, 0.0 when there is nothing to divide by.

The conversions go through u32 because f64::from only takes those: every count this module forms is words, terms or clips, and four billion of any is far past what a corpus or a sentence holds, so the saturation arm is unreachable in fact and only keeps the function total.