fn clamp_ratio(mut ratio: f64) -> f64 {
    ratio = f64::clamp(ratio, 0.0, f64::MAX);

    if ratio == 0.0 {
        warn!("Provided ratio was <= 0.0.");
        1.0
    } else {
        ratio
    }
}
/// Clamps the ratio between 0.0 and f64::MAX
/// If ratio is 0.0 then it will return 1.0 to avoid creating NaN
Clamps the ratio between 0.0 and f64::MAX
If ratio is 0.0 then it will return 1.0 to avoid creating NaN
Clamps the ratio between 0 . 0 and f64 :: MAX If ratio is 0 . 0 then it will return 1 . 0 to avoid creating NaN
fn clamp_ratio(mut ratio: f64) -> f64 {
    ratio = f64::clamp(ratio, 0.0, f64::MAX);
    if ratio == 0.0 {
        warn!("Provided ratio was <= 0.0.");
        1.0
    } else {
        ratio
    }
}
fn clamp_ratio ( mut ratio : f64 ) -> f64 { ratio = f64 :: clamp ( ratio , 0.0 , f64 :: MAX ) ; if ratio == 0.0 { warn ! ( " " ) ; 1.0 } else { ratio } }
Clamps the ratio between 0.0 and f64::MAX
If ratio is 0.0 then it will return 1.0 to avoid creating NaN
Clamps the ratio between 0 . 0 and f64 :: MAX If ratio is 0 . 0 then it will return 1 . 0 to avoid creating NaN
ratio
f64
ratio
f64