Trait kas_widgets::SliderType [−][src]
pub trait SliderType: Copy + Debug + PartialOrd + Add<Output = Self> + Sub<Output = Self> + 'static {
fn div_as_f64(self, rhs: Self) -> f64;
fn mul_f64(self, scalar: f64) -> Self;
}
Expand description
Requirements on type used by Slider
Required methods
fn div_as_f64(self, rhs: Self) -> f64
fn div_as_f64(self, rhs: Self) -> f64
Divide self by another instance of this type, returning an f64
Note: in practice, we always have rhs >= self
and expect the result
to be between 0 and 1.
Return the result of multiplying self by an f64
scalar
Note: the scalar
is expected to be between 0 and 1, hence this
operation should not produce a value larger than self.
Also note that this method is not required to preserve precision
(e.g. u128::mul_64
may drop some low-order bits with large numbers).