diff --git a/core/src/num/unit.rs b/core/src/num/unit.rs index a80b9e93..a2b58d45 100644 --- a/core/src/num/unit.rs +++ b/core/src/num/unit.rs @@ -753,10 +753,7 @@ impl Value { exact: res_exact, } .mul( - &Exact { - value: comp.unit.scale.clone().into(), - exact: true, - }, + &comp.unit.scale.pow(comp.exponent, int)?.apply(Dist::from), int, )?; res_value = adjusted_res.value; diff --git a/core/tests/integration_tests.rs b/core/tests/integration_tests.rs index 2435de59..041e1665 100644 --- a/core/tests/integration_tests.rs +++ b/core/tests/integration_tests.rs @@ -5822,3 +5822,11 @@ fn simplification_ohms() { fn simplification_ohms_2() { test_eval("4556 volt / ampere", "4556 ohms"); } + +#[test] +fn alias_sqrt() { + test_eval( + "partial_result = 2*(0.84 femto meter) / (1.35e-22 m/s^2); sqrt(partial_result)", + "approx. 3527.6684147527 s", + ); +}