num_bound

Trait that adds a bound function.

Automatically implemented for anything that is Ord

Usage

bound(&self, lower: &Self, upper: &Self) -> &Self ```rust let upper = 500; let lower = 200;

asserteq!(300.bound(&lower, &upper), 300); asserteq!(550.bound(&lower, &upper), 500); assert_eq!(100.bound(&lower, &upper), 200); ```