pub(crate) fn scale_factor(&self) -> Number {
        match *self {
            Unit::Em | Unit::Rem => Number::rational(10, 2),
            Unit::Ex => Number::rational(10, 3),
            Unit::Ch => Number::rational(10, 4),
            Unit::Vw | Unit::Vh | Unit::Vmin | Unit::Vmax => one(),
            Unit::Cm => Number::rational(10, 1),
            Unit::Mm => one(),
            Unit::Q => Number::rational(1, 4),
            Unit::In => Number::rational(254, 10),
            Unit::Pt => Number::rational(254, 720),
            Unit::Pc => Number::rational(254, 60),
            Unit::Px => Number::rational(254, 960),

            Unit::Deg => Number::rational(1, 360),
            Unit::Grad => Number::rational(1, 400),
            Unit::Rad => (FRAC_1_PI / 2.0).into(), // 1/(2 pi)
            Unit::Turn => one(),

            Unit::S => one(),
            Unit::Ms => Number::rational(1, 1000),

            Unit::Hz => one(),
            Unit::Khz => Number::rational(1000, 1),

            Unit::Dpi => Number::rational(1, 96),
            Unit::Dpcm => Number::rational(254, 9600),
            Unit::Dppx => one(),

            Unit::Percent => Number::rational(1, 100),
            Unit::Fr => one(),
            Unit::None => one(),

            Unit::Unknown(_) => one(),
        }
    }
/// Some of these are exact and correct, others are more arbitrary.
/// When comparing 10cm to 4in, these factors will give correct results.
/// When comparing rems to vw, who can say?
Some of these are exact and correct, others are more arbitrary.
When comparing 10cm to 4in, these factors will give correct results.
Some of these are exact and correct others are more arbitrary . When comparing 10cm to 4in these factors will give correct results .
pub(crate) fn scale_factor(&self) -> Number {
        match *self {
            Unit::Em | Unit::Rem => Number::rational(10, 2),
            Unit::Ex => Number::rational(10, 3),
            Unit::Ch => Number::rational(10, 4),
            Unit::Vw | Unit::Vh | Unit::Vmin | Unit::Vmax => one(),
            Unit::Cm => Number::rational(10, 1),
            Unit::Mm => one(),
            Unit::Q => Number::rational(1, 4),
            Unit::In => Number::rational(254, 10),
            Unit::Pt => Number::rational(254, 720),
            Unit::Pc => Number::rational(254, 60),
            Unit::Px => Number::rational(254, 960),
            Unit::Deg => Number::rational(1, 360),
            Unit::Grad => Number::rational(1, 400),
            Unit::Rad => (FRAC_1_PI / 2.0).into(), // 1/(2 pi)
            Unit::Turn => one(),
            Unit::S => one(),
            Unit::Ms => Number::rational(1, 1000),
            Unit::Hz => one(),
            Unit::Khz => Number::rational(1000, 1),
            Unit::Dpi => Number::rational(1, 96),
            Unit::Dpcm => Number::rational(254, 9600),
            Unit::Dppx => one(),
            Unit::Percent => Number::rational(1, 100),
            Unit::Fr => one(),
            Unit::None => one(),
            Unit::Unknown(_) => one(),
        }
    }
pub ( crate ) fn scale_factor ( & self ) -> Number { match * self { Unit :: Em | Unit :: Rem => Number :: rational ( 10 , 2 ) , Unit :: Ex => Number :: rational ( 10 , 3 ) , Unit :: Ch => Number :: rational ( 10 , 4 ) , Unit :: Vw | Unit :: Vh | Unit :: Vmin | Unit :: Vmax => one ( ) , Unit :: Cm => Number :: rational ( 10 , 1 ) , Unit :: Mm => one ( ) , Unit :: Q => Number :: rational ( 1 , 4 ) , Unit :: In => Number :: rational ( 254 , 10 ) , Unit :: Pt => Number :: rational ( 254 , 720 ) , Unit :: Pc => Number :: rational ( 254 , 60 ) , Unit :: Px => Number :: rational ( 254 , 960 ) , Unit :: Deg => Number :: rational ( 1 , 360 ) , Unit :: Grad => Number :: rational ( 1 , 400 ) , Unit :: Rad => ( FRAC_1_PI / 2.0 ) . into ( ) , // 1/(2 pi) Unit :: Turn => one ( ) , Unit :: S => one ( ) , Unit :: Ms => Number :: rational ( 1 , 1000 ) , Unit :: Hz => one ( ) , Unit :: Khz => Number :: rational ( 1000 , 1 ) , Unit :: Dpi => Number :: rational ( 1 , 96 ) , Unit :: Dpcm => Number :: rational ( 254 , 9600 ) , Unit :: Dppx => one ( ) , Unit :: Percent => Number :: rational ( 1 , 100 ) , Unit :: Fr => one ( ) , Unit :: None => one ( ) , Unit :: Unknown ( _ ) => one ( ) , } }
Some of these are exact and correct, others are more arbitrary.
Some of these are exact and correct others are more arbitrary .
&self