Function wrapf
pub fn wrapf(value: f64, min: f64, max: f64) -> f64Expand description
Wraps the float value between min and max. min is inclusive while max is exclusive. This can be used for creating loop-like behavior or infinite surfaces.
# Infinite loop between 5.0 and 9.9
value = wrapf(value + 0.1, 5.0, 10.0)# Infinite rotation (in radians)
angle = wrapf(angle + 0.1, 0.0, TAU)# Infinite rotation (in radians)
angle = wrapf(angle + 0.1, -PI, PI)Note: If min is 0, this is equivalent to [method fposmod], so prefer using that instead. [method wrapf] is more flexible than using the [method fposmod] approach by giving the user control over the minimum value.