fn compare_scaled_magnitudes(d1: &Decimal, d2: &Decimal) -> Ordering {
        let exponent_delta = d2.exponent - d1.exponent;
        let mut adjusted_magnitude: BigUint = d2.coefficient.magnitude().to_biguint().unwrap();
        adjusted_magnitude *= 10u64.pow(exponent_delta as u32);
        let cmp = Magnitude::BigUInt(adjusted_magnitude).cmp(&d1.coefficient.magnitude());
        cmp
    }
// d1 must have a smaller exponent than d2
d1 must have a smaller exponent than d2
d1 must have a smaller exponent than d2
fn compare_scaled_magnitudes(d1: &Decimal, d2: &Decimal) -> Ordering {
        let exponent_delta = d2.exponent - d1.exponent;
        let mut adjusted_magnitude: BigUint = d2.coefficient.magnitude().to_biguint().unwrap();
        adjusted_magnitude *= 10u64.pow(exponent_delta as u32);
        let cmp = Magnitude::BigUInt(adjusted_magnitude).cmp(&d1.coefficient.magnitude());
        cmp
    }
fn compare_scaled_magnitudes ( d1 : & Decimal , d2 : & Decimal ) -> Ordering { let exponent_delta = d2 . exponent - d1 . exponent ; let mut adjusted_magnitude : BigUint = d2 . coefficient . magnitude ( ) . to_biguint ( ) . unwrap ( ) ; adjusted_magnitude *= 10u64 . pow ( exponent_delta as u32 ) ; let cmp = Magnitude :: BigUInt ( adjusted_magnitude ) . cmp ( & d1 . coefficient . magnitude ( ) ) ; cmp }
d1 must have a smaller exponent than d2
d1 must have a smaller exponent than d2
d1
&Decimal
d2
&Decimal
d1
&Decimal
d2
&Decimal