Skip to content

Commit

Permalink
Fixed simplificiation of 2(2x).
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrake-merani committed Oct 11, 2024
1 parent 7356e94 commit 3d46eb8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sasdata/quantities/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@ def _clean_ab(self, a, b):
# Convert constant "a"*"b" to "a*b"
return Constant(a.evaluate({}) * b.evaluate({}))._clean()

elif isinstance(a, ConstantBase) and isinstance(b, Mul) and isinstance(b.a, ConstantBase):
return Mul(Constant(a.evaluate({}) * b.a.evaluate({})), b.b)

elif isinstance(a, Inv) and isinstance(b, Inv):
return Inv(Mul(a.a, b.a))

Expand Down

0 comments on commit 3d46eb8

Please sign in to comment.