Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretty-printed pi-products are not properly parenthesized #943

Closed
ecpeterson opened this issue Jul 15, 2019 · 2 comments
Closed

Pretty-printed pi-products are not properly parenthesized #943

ecpeterson opened this issue Jul 15, 2019 · 2 comments
Assignees
Labels
bug 🐛 An issue that needs fixing.
Milestone

Comments

@ecpeterson
Copy link
Contributor

The clever use of associativity to discard parens in _expression_to_string interacts badly with the pi-multiple pretty-printing in _check_for_pi, resulting in inequivalent serializations like these:

In : print(Program("RX(%theta/(2*pi)) 0"))
Out: RX(%theta/2*pi) 0
@ecpeterson ecpeterson added the bug 🐛 An issue that needs fixing. label Jul 15, 2019
@karalekas
Copy link
Contributor

say that five times fast

@karalekas karalekas added this to the v2.11 milestone Jul 29, 2019
@karalekas karalekas modified the milestones: v2.11, v2.12 Aug 23, 2019
@karalekas karalekas added the good first issue 👶 A place to get started. label Sep 10, 2019
notmgsk added a commit that referenced this issue Sep 12, 2019
Rather than trying to figure it out before printing.

Closes #943.
notmgsk added a commit that referenced this issue Sep 12, 2019
Rather than trying to figure it out before printing.

Closes #943.
@notmgsk notmgsk self-assigned this Sep 12, 2019
@karalekas karalekas modified the milestones: v2.12, v2.13 Sep 28, 2019
@notmgsk notmgsk removed the good first issue 👶 A place to get started. label Oct 22, 2019
@notmgsk notmgsk changed the title Pretty-printed pi-multiples are not properly parenthesized Pretty-printed pi-products are not properly parenthesized Oct 24, 2019
@karalekas
Copy link
Contributor

Fixed in #1076

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue that needs fixing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants