Trait aurum_numeric::Clamp
[−]
[src]
pub trait Clamp: Sized + PartialOrd { fn clamp_min() -> Self; fn clamp_max() -> Self; fn is_clamp_nan(&self) -> bool; fn clamp(self) -> Self { ... } }
Trait for scalar values which have a "clamped" range.
For integer values, the clamped range is from 0 to $ty::MAX
.
For floating point values, the clamped range is from 0.0 to 1.0.