fn clamp(x: f64, x1: f64, x2: f64) -> f64 {
    if x < x1 {
        x1
    } else if x > x2 {
        x2
    } else {
        x
    }
}
//ensure a number always falls in the given range
ensure a number always falls in the given range
ensure a number always falls in the given range
fn clamp(x: f64, x1: f64, x2: f64) -> f64 {
    if x < x1 {
        x1
    } else if x > x2 {
        x2
    } else {
        x
    }
}
fn clamp ( x : f64 , x1 : f64 , x2 : f64 ) -> f64 { if x < x1 { x1 } else if x > x2 { x2 } else { x } }
ensure a number always falls in the given range
ensure a number always falls in the given range
x
f64
x1
f64
x2
f64