Skip to content

Commit

Permalink
Revert ast change
Browse files Browse the repository at this point in the history
  • Loading branch information
probablykasper committed Oct 26, 2024
1 parent 78495d4 commit b7b78e2
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions core/src/num/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,24 +283,10 @@ impl Value {
println!("\t{:?}", rhs);
let mut components = self.unit.components.clone();
for rhs_component in rhs.unit.components {
let mut self_has_unit = false;
for self_component in &self.unit.components {
if compare_hashmaps(
&self_component.unit.base_units,
&rhs_component.unit.base_units,
int,
)? {
self_has_unit = true;
break;
}
}
let new_exponent = if self_has_unit {
-rhs_component.exponent
} else {
rhs_component.exponent
};
println!("\t\t{:?}", new_exponent);
components.push(UnitExponent::new(rhs_component.unit, new_exponent));
components.push(UnitExponent::new(
rhs_component.unit,
-rhs_component.exponent,
));
}
let value =
Exact::new(self.value, self.exact).div(&Exact::new(rhs.value, rhs.exact), int)?;
Expand Down

0 comments on commit b7b78e2

Please sign in to comment.