Skip to content

Commit

Permalink
Use multiplication instead of division to avoid floating point error.
Browse files Browse the repository at this point in the history
  • Loading branch information
eskildsf committed Jan 4, 2025
1 parent 7f3d6d9 commit cbdfdc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pint/facets/plain/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ def terms_are_unique(fraction):
if d_exponent == 0:
del fraction["denominator"][d_factor]
else:
factor /= d_factor**d_exponent
factor *= d_factor**-d_exponent

units = self.UnitsContainer(
{k: v for k, v in accumulators.items() if k is not None and v != 0}
Expand Down

0 comments on commit cbdfdc5

Please sign in to comment.