Skip to main content

saturating

Function saturating 

Source
pub fn saturating(value: f64, half: f64) -> f64
Expand description

A count mapped onto 0..1 by how far past half it reaches.

half earns exactly one half; nothing earns 1. A negative or zero half has no reference to measure against and scores nothing, rather than dividing by zero.