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

Add missing parentheses around vectors in IJK mode. #321

Merged
merged 1 commit into from
Aug 2, 2017

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Aug 2, 2017

When vectors are printed in IJK mode as part of a formula, parentheses may be needed around them, as in 2(i+3t-k), but MathObjects isn't inserting these. This PR resolves that issue.

To test, use

Context("Vector")->flags->set(ijk=>1);
TEXT(Compute("2<1,x,3>"),$BR);
TEXT(Compute("2<0,-x,0>"),$BR);
TEXT(Compute("2<0,x,0>"),$BR);

Without the patch, you will get 2*i+xj+3k, 2*-xj and 2*xj. With the patch, you will get (the correct results) 2*(i+xj+3k), 2*(-xj) and 2*xj.

See the associated bug report.

@mgage
Copy link
Member

mgage commented Aug 2, 2017

This works as described and resolves bug3702.

@mgage mgage merged commit 9475f7f into openwebwork:develop Aug 2, 2017
@dpvc dpvc deleted the ijk-patch branch October 14, 2017 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants