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

Make sure initial context is Numeric #335

Merged
merged 1 commit into from
Dec 30, 2017

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Dec 28, 2017

This PR addresses Alex's comments concerning the default MathObject context when no Context() is specified. It does so by explicitly setting the context to Numeric, which is what was supposed to have happened anyway, but do to a timing problem, that wasn't the case; the PG environment values weren't being added to the context properly. So tolerance, useBaseTenLog and some other values were not the same as they would be if Context("Numeric") was performed explicitly.

This can be tested by using:

DOCUMENT();
loadMacros(
  "PGstandard.pl",
  "MathObjects.pl",
);
TEXT(Context()->flag('tolerance'), $BR);
Context("Numeric");
TEXT(Context()->flag('tolerance'), $BR);
ENDDOCUMENT();

With the patch, both values should be the same, without the patch, they will be different by a factor of 10.

@mgage
Copy link
Sponsor Member

mgage commented Dec 30, 2017

This fixes the initialization problem

@mgage mgage merged commit ed8c717 into openwebwork:develop Dec 30, 2017
This was referenced Dec 30, 2017
@dpvc dpvc deleted the fix-default-context branch January 5, 2018 21:31
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.

None yet

2 participants