pub fn rescale<T: FromPrimitive + ToPrimitive + Copy>(fact: Percent, a: T, b: T) -> Option<(T, T)> {
    Some((
        T::from_f64((a.to_f64()? * fact).floor())?,
        T::from_f64((b.to_f64()? * fact).floor())?,
    ))
}
/// Rescales number with f64 factor
/// returns None if result can't be converted back to original data type
Rescales number with f64 factor
returns None if result can't be converted back to original data type
Rescales number with f64 factor returns None if result can ' t be converted back to original data type
pub fn rescale<T: FromPrimitive + ToPrimitive + Copy>(fact: Percent, a: T, b: T) -> Option<(T, T)> {
    Some((
        T::from_f64((a.to_f64()? * fact).floor())?,
        T::from_f64((b.to_f64()? * fact).floor())?,
    ))
}
pub fn rescale < T : FromPrimitive + ToPrimitive + Copy > ( fact : Percent , a : T , b : T ) -> Option < ( T , T ) > { Some ( ( T :: from_f64 ( ( a . to_f64 ( ) ? * fact ) . floor ( ) ) ? , T :: from_f64 ( ( b . to_f64 ( ) ? * fact ) . floor ( ) ) ? , ) ) }
Rescales number with f64 factor
returns None if result can't be converted back to original data type
Rescales number with f64 factor returns None if result can ' t be converted back to original data type
fact
Percent
a
T
b
T
fact
Percent
a
T
b
T